• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Plugin serialization

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm making a program that will basically allow for Application plugins(almost like the APK "Plugins" for android) that is basically an abstract class called Application,
with a method called OnStart();

I want to be able to allow a user to extends the Application class, make their own application, serialize it using an ObjectOutputStream, and put it in the folder that is designated to application installation in my program.
From there, the program will "install it" (aka, Deserialize the user's application) and be able to run it. The problem is, is when I go to make a new class, and extend the abstract Application class, it gives the new class it's own serialization ID.

This will not allow java to load it up as an extension of the abstract class Application, as it has it's own ID.

Any input, as to how I can resolve this?

Thanks![
 
Marshal
Posts: 4501
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not have the plugin be a java class file, or a jar file bundling one or more plugins?

I looked at something similar described in this post.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anthony Daub wrote:This will not allow java to load it up as an extension of the abstract class Application, as it has it's own ID.



It's not obvious to me why that's a problem. Could you elaborate on the question by posting your code and the error messages you get?
 
Saloon Keeper
Posts: 7585
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Serialization is tricky to use unless you can be sure that the JVMs on both sides are of the same version. Something along the lines of what Ron describes was presented in http://www.javaranch.com/journal/200607/Journal200607.jsp#a1
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic