org.objectweb.jonas.adm
Class Adm

java.lang.Object
  extended by javax.rmi.PortableRemoteObject
      extended by org.objectweb.jonas.adm.Adm
All Implemented Interfaces:
Remote, AdmInterface

public class Adm
extends PortableRemoteObject
implements AdmInterface

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

Author:
Philippe Coq, Philippe Durieux, Marc Dutoo, JOnAS 2.4, Murad Meghani (Murad.Meghani@compuware.com) killServer and stopServer, Florent Benoit & Ludovic Bert : Methods for wars and ear files JOnAS 2.5 2002.06, Dean Jennings : add deployFile

Field Summary
static int SLEEP_DELAY
          Sleep before exit of JVM
 
Fields inherited from interface org.objectweb.jonas.adm.AdmInterface
ADMNAME_SUFFIX, NOT_READY, READY, STATUS_ALL, STATUS_RUNNING, STATUS_STOPPED, STOPPED, TYPE_CAR, TYPE_EAR, TYPE_EJB, TYPE_RAR, TYPE_WAR
 
Constructor Summary
Adm(JProp jp)
          Adm constructor
 
Method Summary
 void addBeans(String fileName)
          Create a container and load beans in it
 void addEar(String fileName)
          Deploy a given ear file with the help of the ear service.
 void addRar(String fileName)
          Deploy a given rar file with the help of the resource service.
 void addWar(String fileName)
          Deploy a given war file with the help of the web container service.
 void deployFileOn(String filename, String[] target)
          Deploy file on another server or a cluster.
 String dumpCustom()
           
 int getServerState()
          To test if the server is ready
 String getTopicLevel(String topic)
          get Topic Level
 String[] getTopics()
          get Topics.
 boolean isEarLoaded(String fileName)
          Test if the specified filename is already deployed or not
 boolean isEJBContainer()
          To test if the server is an EJB container
 boolean isLoaded(String fileName)
          returns true if beans are already loaded in server.
 boolean isRarLoaded(String fileName)
          Test if the specified filename is already deployed or not
 boolean isWarLoaded(String fileName)
          Test if the specified filename is already deployed or not
 void killServer()
          Stop the Server and stop the JVM
 String[] listBeans()
          List beans of all JOnAS containers
 Vector listContext()
          List JNDI context
 Properties listEnv()
          List Environment (configuration properties provided by the configuration file).
 void removeBeans(String fileName)
          Remove the container identified by fileName and remove all beans in it
 void removeEar(String fileName)
          UnDeploy a given ear file with the help of the ear service.
 void removeRar(String fileName)
          UnDeploy a given rar file with the help of the resource service.
 void removeWar(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(String topic, String l)
          set Topic Level
 void setTransactionTimeout(int timeout)
          set the default value for transaction timeout
 void startRemoteServers(String[] target)
          Start remote servers or clusters
 void stopRemoteServers(String[] target)
          Stop remote servers or clusters
 void stopServer()
          Stop the Server without stopping the JVM
 void syncAllEntities(boolean passivate)
          sync all entity instances outside transactions
 
Methods inherited from class javax.rmi.PortableRemoteObject
connect, exportObject, narrow, toStub, unexportObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLEEP_DELAY

public static final int SLEEP_DELAY
Sleep before exit of JVM

See Also:
Constant Field Values
Constructor Detail

Adm

public Adm(JProp jp)
    throws RemoteException,
           NamingException,
           ServiceException,
           Exception
Adm constructor

Throws:
RemoteException - if problem
NamingException
ServiceException
Exception
Method Detail

getTopics

public String[] getTopics()
                   throws RemoteException
get Topics. Assumes that all Loggers are TopicalLoggers.

Specified by:
getTopics in interface AdmInterface
Throws:
RemoteException

getTopicLevel

public String getTopicLevel(String topic)
                     throws RemoteException
get Topic Level

Specified by:
getTopicLevel in interface AdmInterface
Throws:
RemoteException

setTopicLevel

public void setTopicLevel(String topic,
                          String l)
                   throws RemoteException
set Topic Level

Specified by:
setTopicLevel in interface AdmInterface
Throws:
RemoteException

addBeans

public void addBeans(String fileName)
              throws 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
Throws:
RemoteException

addEar

public void addEar(String fileName)
            throws RemoteException,
                   AdmException
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:
RemoteException - if rmi call failed.
EarServiceException - if the deployment failed.
AdmException - if the deployment failed.

isEarLoaded

public boolean isEarLoaded(String fileName)
                    throws RemoteException,
                           AdmException
Test if the specified filename is already deployed or not

Specified by:
isEarLoaded in interface AdmInterface
Parameters:
fileName - the name of the ear file.
Returns:
true if the ear is deployed, else false.
Throws:
RemoteException - if rmi call failed.
AdmException

addRar

public void addRar(String fileName)
            throws RemoteException,
                   AdmException
Deploy a given rar file with the help of the resource service.

Specified by:
addRar in interface AdmInterface
Parameters:
fileName - the name of the rar file.
Throws:
RemoteException - if rmi call failed.
AdmException - if the deployment failed.

isRarLoaded

public boolean isRarLoaded(String fileName)
                    throws RemoteException,
                           AdmException
Test if the specified filename is already deployed or not

Specified by:
isRarLoaded in interface AdmInterface
Parameters:
fileName - the name of the rar file.
Returns:
true if the rar is deployed, else false.
Throws:
RemoteException - if rmi call failed.
AdmException - if unable to get resource service

addWar

public void addWar(String fileName)
            throws RemoteException,
                   AdmException
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:
RemoteException - if rmi call failed.
AdmException - if the deployment failed.

isWarLoaded

public boolean isWarLoaded(String fileName)
                    throws RemoteException,
                           AdmException
Test if the specified filename is already deployed or not

Specified by:
isWarLoaded in interface AdmInterface
Parameters:
fileName - the name of the war file.
Returns:
true if the war is deployed, else false.
Throws:
RemoteException - if rmi call failed.
AdmException

removeEar

public void removeEar(String fileName)
               throws RemoteException,
                      AdmException
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:
RemoteException - if rmi call failed.
AdmException - if the undeployment failed.

removeRar

public void removeRar(String fileName)
               throws RemoteException,
                      AdmException
UnDeploy a given rar file with the help of the resource service.

Specified by:
removeRar in interface AdmInterface
Parameters:
fileName - the name of the rar file.
Throws:
RemoteException - if rmi call failed.
AdmException - if the undeployment failed.

removeWar

public void removeWar(String fileName)
               throws RemoteException,
                      AdmException
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:
RemoteException - if rmi call failed.
AdmException - if the undeployment failed.

removeBeans

public void removeBeans(String fileName)
                 throws 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
Throws:
RemoteException

isLoaded

public boolean isLoaded(String fileName)
                 throws 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
Throws:
RemoteException

dumpCustom

public String dumpCustom()
                  throws RemoteException
Specified by:
dumpCustom in interface AdmInterface
Throws:
RemoteException

listBeans

public String[] listBeans()
                   throws RemoteException
List beans of all JOnAS containers

Specified by:
listBeans in interface AdmInterface
Throws:
RemoteException

listContext

public Vector listContext()
                   throws RemoteException
List JNDI context

Specified by:
listContext in interface AdmInterface
Throws:
RemoteException

listEnv

public Properties listEnv()
List Environment (configuration properties provided by the configuration file).

Specified by:
listEnv in interface AdmInterface

stopServer

public void stopServer()
                throws RemoteException
Stop the Server without stopping the JVM

Specified by:
stopServer in interface AdmInterface
Throws:
RemoteException

killServer

public void killServer()
                throws RemoteException
Stop the Server and stop the JVM

Specified by:
killServer in interface AdmInterface
Throws:
RemoteException

getServerState

public int getServerState()
                   throws RemoteException
To test if the server is ready

Specified by:
getServerState in interface AdmInterface
Returns:
int 0=not ready, 1=ready, 2=stopped
Throws:
RemoteException

isEJBContainer

public boolean isEJBContainer()
                       throws RemoteException
To test if the server is an EJB container

Specified by:
isEJBContainer in interface AdmInterface
Throws:
RemoteException

setTransactionTimeout

public void setTransactionTimeout(int timeout)
                           throws RemoteException
set the default value for transaction timeout

Specified by:
setTransactionTimeout in interface AdmInterface
Throws:
RemoteException

runGC

public void runGC()
           throws RemoteException
run the garbage collector

Specified by:
runGC in interface AdmInterface
Throws:
RemoteException

syncAllEntities

public void syncAllEntities(boolean passivate)
                     throws RemoteException
sync all entity instances outside transactions

Specified by:
syncAllEntities in interface AdmInterface
Parameters:
passivate - passivate instances after synchronization.
Throws:
RemoteException

serverReady

public void serverReady(boolean isEJB)
server is ready


startRemoteServers

public void startRemoteServers(String[] target)
                        throws RemoteException
Start remote servers or clusters

Specified by:
startRemoteServers in interface AdmInterface
Parameters:
target - List of clusters or servers to start
Throws:
RemoteException

stopRemoteServers

public void stopRemoteServers(String[] target)
                       throws RemoteException
Stop remote servers or clusters

Specified by:
stopRemoteServers in interface AdmInterface
Parameters:
target - List of clusters or servers to stop
Throws:
RemoteException

deployFileOn

public void deployFileOn(String filename,
                         String[] target)
                  throws RemoteException
Deploy file on another server or a cluster.

Specified by:
deployFileOn in interface AdmInterface
Parameters:
filename - Name of the file
target - List of clusters or servers where to deploy the file.
Throws:
RemoteException


Copyright © 2007 OW2 Consortium. All Rights Reserved.