If you're working from a source distribution you can go into
org.jboss.dependencies.DependencyManager and set the "debug" flag to true,
and then you'll see the entire dependency analysis and that may give you
some useful info.
        However, there's one thing I should point out.  The dependencies
don't have any effect on loading services, only on starting them.  It
looks to me like you do all your work when your service is loaded (in
preRegister), and that's probably why it's running no matter what.
        If you change your MBean and interface to extend ServiceMBean and
ServiceMBeanSupport (org.jboss.util) and put the work in the startService
method, or just declare a "start" and put the work in there, it would
probably work.

Aaron

On Tue, 14 Nov 2000, Aadam Daya wrote:
> thanks for your help.  I tried the following but to no avail.
>
> This is what I did.
>
> As you suggested, I added the following to jboss.dependencies:
>
>  <service name="MegaCDStartup">
>     <dependency service="SpyderMQ" required="true"/>
>    </service>
>
> Also, here is the code for my MegaCDStartup class:
>
> package com.nuvation.megacd.services;
>
> import javax.management.*;
> import
> com.nuvation.megacd.processors.fileprocessor.FileProcessorQueueReceiver;
> import com.nuvation.megacd.processors.burningprocessor.BurnQueueReceiver;
> import com.nuvation.megacd.processors.burningprocessor.rimage.RimageHandler;
> import com.nuvation.utilities.Utils;
>
> public class MegaCDStartup
>    implements MegaCDStartupMBean, MBeanRegistration
> {
>       public static final String OBJECT_NAME = ":service=MegaCDStartup";
>
>
>       public ObjectName preRegister(MBeanServer server, ObjectName name)
> throws java.lang.Exception
>       {
>               try
>               {
>
> Utils.populateJNDIApplicationProperties("megacd.properties");
>               }
>               catch (Exception e)
>               {
>                       System.out.println("MegaCDStartup:preRegister(),
> Error getting megacd.properties: " + e.getMessage());//, Utils.ERROR);
>                       System.out.println("MegaCDStartup:preRegister(), " +
> e.getClass().toString());//, Utils.ERROR);
>               }
>
> System.out.println(Utils.getApplicationProperty("com.nuvation.megacd.totalRi
> mages"));
>               FileProcessorQueueReceiver fileProcessorQueueReceiver = new
> FileProcessorQueueReceiver();
>               fileProcessorQueueReceiver.init();
>
>               BurnQueueReceiver burnQueueReceiver = new
> BurnQueueReceiver();
>               burnQueueReceiver.init();
>
>               RimageHandler.populateRimages();
>               System.out.println("initialization done");
>               return new ObjectName(OBJECT_NAME);
>       }
> public void postRegister(java.lang.Boolean registrationDone)
>               {
>               }
>               public void preDeregister()
>                       throws java.lang.Exception
>               {
>               }
>               public void postDeregister()
>               {
>               }
> }
>
> When I start JBOSS, the above MegaCDStartup is still run even though I added
> the lines to the jboss.dependencies. Do you have any ideas on why this is
> happening?  Thanks for your help?
>
> Aadam
>
> -----Original Message-----
> From: Aaron Mulder [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 14, 2000 2:41 PM
> To: jBoss
> Subject: Re: [jBoss-User] dependencies
>
>
>       Here's an existing entry:
>
>   <service name="Log">
>     <dependency service="Configuration" required="true"/>
>   </service>
>
>       You need to update the service name and dependency service name.
> The first service name is your service, the dependency service name is the
> SpyderMQ service name.  As for the "required" parameter:
>
>  - If "true" then your service will not start unless SpyderMQ is present
>
>  - If "false" then SpyderMQ will be started before your service if
>    SpyderMQ is present, and your service will be started anyway if
>    SpqderMQ is not present.
>
>       So the next trick is how you figure out the name of the service.
> First, look at the JMX ObjectName.  Find a substring like "service=Foo",
> where substrings are delimited by commas and semicolons, and the service
> name is the part after the =.  So for example, if the object name is
> "Default;service=Bar;instance=#1A" then the service name is "Bar".  You
> should know the ObjectName for your service, and it look like the SpyderMQ
> ObjectName is ":service=SpyderMQ".
>       Note that there must be a "service=XXX" in your service's
> ObjectName for this to work.
>
> Aaron
>
>
> On Tue, 14 Nov 2000, Aadam Daya wrote:
> > Hi.  I have a small startup routine which does some of our
> > initializations in our application.  For this routine, we have an mbean
> > which is
> > specified in the jboss.conf.  This is the line in my jboss.conf:
> >
> > <MLET CODE = "com.nuvation.megacd.services.MegaCDStartup"
> > ARCHIVE="ifactory.jar" CODEBASE="../lib/ext/">
> >   </MLET>
> >
> > This seems to startup fine, but the code that is run here depends on
> > spydermq being present and running.
> >
> > What would I write in the jboss.dependencies so that our startup
> > initialization bean will not run until spydermq is loaded?
> >
> > Thanks,
> >
> > Aadam
> >
> >
> >
>
>
>
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]
>



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to