"Niclas Hedhman" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:<[EMAIL PROTECTED]>... > On Sunday 30 May 2004 02:49, Eike Stepper wrote: > > you are right. i'll try to let merlin run embedded in an eclipse plugin at > > client-side. in fact i already succeeded to port the "generic embedding" > > example to a plugin. the resulting DefaultKernel is obviously running and > > can be shut down programatically. but i have no clue how to make my block > > boot. could you give me one more hint? > > Boot (?) the block?? > Do you mean loading it into the kernel container?
yes ;-) > Do you mean getting it to run once it has been loaded? > > Embedding is not my area, but I assume you are doing something like; > > InitialContextFactory initial = > new DefaultInitialContextFactory( "merlin" ); > File home = initial.getHomeDirectory(); > initial.setCacheDirectory( new File( home, "system" ) ); > InitialContext context = initial.createInitialContext(); > > String spec = "artifact:merlin/merlin-impl#3.3.0"; > Artifact artifact = Artifact.createArtifact( spec ); > Builder builder = context.newBuilder( artifact ); > Factory factory = builder.getFactory(); > Map criteria = factory.createDefaultCriteria(); > > to get everything established before creating the kernel. > I think(!) you need to do a > > criteria.put( "merlin.deployment", arguments ); > Kernel kernel = factory.create( criteria ); > kernel.startup(); > > where 'arguments' is a string array containing the 'rest of commandline', i.e. > the block file. i've just learned (by trying) that it also seems to work, if i put a file BLOCK-INF/block.xml into the plugin's source folder. would you say that is equal to the criteria way? > > the more i think about it the more i like the idea to combine both merlin > > and eclipse at client-side as well as at server-side (but eclipse in > > headless-mode to avoid the ui). this way the merlin (avalon?) components > > could benefit from eclipse's plugin registry and its web update manager. > > IMHO, Merlin's remote repository functionality is superior of the update > manager. Declare your resources in the block and give Repository (the > subsystem) an URL to your local repo-server (http) and/or global ones, for > central administration of Jars. > Even Merlin itself can bootstrap from a http server, if that is needed, and > since you are embedding you can take great advantage of that. interesting idea to use merlins remote repository but i fear my client depends on the plugin registry of eclipse anyway. in addition my application just uses the (open source) cdo framework, on top of which i build a commercial product, where branding and licensing will play an important role to provide me bread and a bed ;-)) but nevertheless it seems feasible and interesting to combine eclipse and merlin and i will go that way... /eike --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
