psdi.server

Class Depend

  • java.lang.Object
    • psdi.server.Depend
  • All Implemented Interfaces:
    FixedLoggerNames, FixedLoggers


    public class Depend
    extends java.lang.Object
    implements FixedLoggers
    This class allows the thread of execution to "block" until a specified Service is running. The Service is running in another thread of course.
    • Field Detail

      • sleep

        protected int sleep
        Seconds to sleep. Defaults to 5
    • Constructor Detail

      • Depend

        public Depend()
    • Method Detail

      • setSleep

        public void setSleep(int value)
        The unit is Seconds. Sets the amount of time to 'sleep' between making calls to isRunning() on a Service if it responds with isRunning() == false.
        Parameters:
        value -
      • getSleep

        public int getSleep()
        The unit is Seconds.
      • on

        public void on(java.lang.String serviceName,
                       java.lang.String[] serviceNames)
                throws MXException,
                       java.rmi.RemoteException
        Takes an array of Service names and will return only when they all respond with true to a call of their isRunning() method. Note: this is a BLOCKING call! Throws an MXException if one the Services you're trying to depend on is not implement Dependable! Note: There is a basic assumption that once a Service is running it will not change it's mind and return "false" to subsequent isRunning() calls.
        Parameters:
        serviceName - Name of the Service that has made this call. It's used to simplify monitoring. You MUST insure that the names used in the serviceNames[] are the names returned by each Service's getName() method; in the case of an AppService derived class, you should look it up in the Maximo data dictionary.
        serviceNames - Array of names of Services that this Service is depending on.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Service, AppService