org.objectweb.jonas.adm
Class Adm

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--org.objectweb.common.RemoteObject
                          |
                          +--org.objectweb.jonas.adm.Adm
All Implemented Interfaces:
AdmInterface, java.rmi.Remote, java.io.Serializable

public class Adm
extends RemoteObject
implements AdmInterface

This class implements a remote interface used for administering the server.

Author:
Philippe Coq, Philippe Durieux Contributor(s): Marc Dutoo, JOnAS 2.4 Murad Meghani (Murad.Meghani@compuware.com) killServer and stopServer JOnAS 2.5 2002.06 Florent Benoit & Ludovic Bert : Methods for wars and ear files
See Also:
Serialized Form

Field Summary
static java.lang.String ADMNAME_SUFFIX
           
static int NOT_READY
           
static int READY
           
static int STOPPED
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
Adm(JProp jp)
          Adm constructor
 
Method Summary
 void addBeans(java.lang.String fileName)
          Create a container and load beans in it
 void addEar(java.lang.String fileName)
          Deploy a given ear file with the help of the ear service.
 void addWar(java.lang.String fileName)
          Deploy a given war file with the help of the web container service.
 int getServerState()
          To test if the server is ready
 java.lang.String getTopicLevel(java.lang.String topic)
          get Topic Level
 java.lang.String[] getTopics()
          get Topics.
 boolean isEJBContainer()
          To test if the server is an EJB container
 boolean isLoaded(java.lang.String fileName)
          returns true if beans are already loaded in server.
 void killServer()
          Stop the Server and stop the JVM
 java.lang.String[] listBeans()
          List beans of all JOnAS containers
 java.util.Vector listContext()
          List JNDI context
 java.util.Properties listEnv()
          List Environment
 void removeBeans(java.lang.String fileName)
          Remove the container identified by fileName and remove all beans in it
 void removeEar(java.lang.String fileName)
          UnDeploy a given ear file with the help of the ear service.
 void removeWar(java.lang.String fileName)
          UnDeploy a given war file with the help of the web container service.
 void runGC()
          run the garbage collector
 void serverReady(boolean isEJB)
          server is ready
 void setTopicLevel(java.lang.String topic, java.lang.String l)
          set Topic Level
 void setTransactionTimeout(int timeout)
          set the default value for transaction timeout
 void stopServer()
          Stop the Server without stopping the JVM
 void syncAllEntities(boolean passivate)
          sync all entity instances outside transactions
 
Methods inherited from class org.objectweb.common.RemoteObject
getPort, setPort
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADMNAME_SUFFIX

public static final java.lang.String ADMNAME_SUFFIX

NOT_READY

public static final int NOT_READY

READY

public static final int READY

STOPPED

public static final int STOPPED
Constructor Detail

Adm

public Adm(JProp jp)
    throws java.rmi.RemoteException,
           javax.naming.NamingException,
           ServiceException
Adm constructor
Method Detail

getTopics

public java.lang.String[] getTopics()
                             throws java.rmi.RemoteException
get Topics. Assumes that all Loggers are TopicalLoggers.
Specified by:
getTopics in interface AdmInterface

getTopicLevel

public java.lang.String getTopicLevel(java.lang.String topic)
                               throws java.rmi.RemoteException
get Topic Level
Specified by:
getTopicLevel in interface AdmInterface

setTopicLevel

public void setTopicLevel(java.lang.String topic,
                          java.lang.String l)
                   throws java.rmi.RemoteException
set Topic Level
Specified by:
setTopicLevel in interface AdmInterface

addBeans

public void addBeans(java.lang.String fileName)
              throws java.rmi.RemoteException
Create a container and load beans in it
Specified by:
addBeans in interface AdmInterface
Parameters:
fileName - name of the ejb-jar or xml file

addEar

public void addEar(java.lang.String fileName)
            throws java.rmi.RemoteException,
                   EarServiceException
Deploy a given ear file with the help of the ear service.
Specified by:
addEar in interface AdmInterface
Parameters:
fileName - the name of the ear file.
Throws:
java.rmi.RemoteException - if rmi call failed.
EarServiceException - if the deployment failed.

addWar

public void addWar(java.lang.String fileName)
            throws java.rmi.RemoteException,
                   org.objectweb.jonas.web.JWebContainerServiceException
Deploy a given war file with the help of the web container service.
Specified by:
addWar in interface AdmInterface
Parameters:
fileName - the name of the war file.
Throws:
java.rmi.RemoteException - if rmi call failed.
org.objectweb.jonas.web.JWebContainerServiceException - if the deployment failed.

removeEar

public void removeEar(java.lang.String fileName)
               throws java.rmi.RemoteException,
                      EarServiceException
UnDeploy a given ear file with the help of the ear service.
Specified by:
removeEar in interface AdmInterface
Parameters:
fileName - the name of the ear file.
Throws:
java.rmi.RemoteException - if rmi call failed.
EarServiceException - if the undeployment failed.

removeWar

public void removeWar(java.lang.String fileName)
               throws java.rmi.RemoteException,
                      org.objectweb.jonas.web.JWebContainerServiceException
UnDeploy a given war file with the help of the web container service.
Specified by:
removeWar in interface AdmInterface
Parameters:
fileName - the name of the war file.
Throws:
java.rmi.RemoteException - if rmi call failed.
org.objectweb.jonas.web.JWebContainerServiceException - if the undeployment failed.

removeBeans

public void removeBeans(java.lang.String fileName)
                 throws java.rmi.RemoteException
Remove the container identified by fileName and remove all beans in it
Specified by:
removeBeans in interface AdmInterface
Parameters:
fileName - name of the ejb-jar or xml file

isLoaded

public boolean isLoaded(java.lang.String fileName)
                 throws java.rmi.RemoteException
returns true if beans are already loaded in server.
Specified by:
isLoaded in interface AdmInterface
Parameters:
fileName - name of the ejb-jar or xml file

listBeans

public java.lang.String[] listBeans()
                             throws java.rmi.RemoteException
List beans of all JOnAS containers
Specified by:
listBeans in interface AdmInterface

listContext

public java.util.Vector listContext()
                             throws java.rmi.RemoteException
List JNDI context
Specified by:
listContext in interface AdmInterface

listEnv

public java.util.Properties listEnv()
List Environment
Specified by:
listEnv in interface AdmInterface

stopServer

public void stopServer()
                throws java.rmi.RemoteException
Stop the Server without stopping the JVM
Specified by:
stopServer in interface AdmInterface

killServer

public void killServer()
                throws java.rmi.RemoteException
Stop the Server and stop the JVM
Specified by:
killServer in interface AdmInterface

getServerState

public int getServerState()
                   throws java.rmi.RemoteException
To test if the server is ready
Specified by:
getServerState in interface AdmInterface
Returns:
int 0=not ready, 1=ready, 2=stopped

isEJBContainer

public boolean isEJBContainer()
                       throws java.rmi.RemoteException
To test if the server is an EJB container
Specified by:
isEJBContainer in interface AdmInterface

setTransactionTimeout

public void setTransactionTimeout(int timeout)
                           throws java.rmi.RemoteException
set the default value for transaction timeout
Specified by:
setTransactionTimeout in interface AdmInterface

runGC

public void runGC()
           throws java.rmi.RemoteException
run the garbage collector
Specified by:
runGC in interface AdmInterface

syncAllEntities

public void syncAllEntities(boolean passivate)
                     throws java.rmi.RemoteException
sync all entity instances outside transactions
Specified by:
syncAllEntities in interface AdmInterface
Parameters:
passivate - passivate instances after synchronization.

serverReady

public void serverReady(boolean isEJB)
server is ready