• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Plugin serialization

 
Anthony Daub
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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![
 
Ron McLeod
Bartender
Pie
Posts: 1027
64
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Posts: 21554
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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?
 
Tim Moores
Bartender
Posts: 3128
50
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic