You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Alexis Agahi <al...@users.sf.net> on 2003/10/18 23:28:48 UTC

Merlin & JBoss

Hi,

With little tweak I've been able to successfully run Merlin as a Jboss service 
(in fact OpenIM running as JBoss applicaiton).

Here is the stuff (it is experimental so stay cool)

1/ Define a MerlinMBean (in kernel/bootstrap) interface defining classical 
JBoss required method

    public void start() throws Exception;
    public void stop() throws Exception;
    public void destroy();

and custom method

    public void setHomePath( String home );
    public String getHomePath();

    public void setConfigFile( String configFile );
    public String getConfigFile();

    public void setTargetFile( String targetFile );
    public String getTargetFile();


2/ Implement MerlinMBean in Merlin
and call the main() method in start() rebuilding a String[] args from 
home/configFile/targetFile


3/ Adjust in Merlin.java the apiClassloader to use current classload as parent

ClassLoader apiLoader = new URLClassLoader( api,  classloader);

(required as there is class conflict with the repository class provided in 
bootstrap and repository provided by merlin/repository


4/ setup JBoss server/---/deploy/merlin-service.xml file

<server>
  <mbean code="Merlin" name="jboss:service=Merlin">
    <attribute name="homePath">/home/Al/openim/</attribute>
    <attribute name="configFile">/home/Al/openim/conf/config.xml</attribute>
    <attribute 
name="targetFile">/home/Al/.maven/repository/openim/jars/openim-server-impl-1.1.1.jar</attribute>
  </mbean>
</server>

5/ copy $MERLIN_HOME/bin/lib/merlin-bootstrap-1.0.jar in server/---/lib/

Now you can lauch jboss and have fun

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: Merlin & JBoss

Posted by Alexis Agahi <al...@users.sf.net>.
On Sunday 19 October 2003 13:35, Leo Simons wrote:
> Alexis Agahi wrote:
> > With little tweak I've been able to successfully run Merlin as a Jboss
> > service (in fact OpenIM running as JBoss applicaiton).
> >
> > Here is the stuff (it is experimental so stay cool)
>
> well, it definately sounds cool :D
>
> Feel like submitting a patch?

huhu :D
I'm going to play with mbean again & then propose a clean patch.

There is also a little problem concerning the classloader, to make things work 
with JBoss I did not find anything else except "extenting" the merlin 
classloader with current classloader: 

ClassLoader apiLoader = new URLClassLoader( api,  classloader);

maybe there is a better solution.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: Merlin & JBoss

Posted by Leo Simons <le...@apache.org>.
Alexis Agahi wrote:
> With little tweak I've been able to successfully run Merlin as a Jboss service 
> (in fact OpenIM running as JBoss applicaiton).
> 
> Here is the stuff (it is experimental so stay cool)

well, it definately sounds cool :D

Feel like submitting a patch?

cheers,

- LSD



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org