org.objectweb.jonas.ear
Class EarServiceImpl

java.lang.Object
  extended byorg.objectweb.jonas.management.ReconfigDispatcher
      extended byorg.objectweb.jonas.service.AbsServiceImpl
          extended byorg.objectweb.jonas.ear.EarServiceImpl
All Implemented Interfaces:
EarService, EarServiceImplMBean, javax.management.NotificationBroadcaster, ReconfigDispatcherMBean, Service

public class EarServiceImpl
extends AbsServiceImpl
implements EarService, EarServiceImplMBean

JOnAS EAR Service Implementation class. This class provides an implementation of the ear service.

Author:
Florent Benoit, Ludovic Bert Contributor(s): Adriana Danes: highlight configuration properties Eric Hardesty: added ability to include rar files in an ear

Field Summary
protected static java.lang.String APPS_DIR
          The name of the apps directory.
static java.lang.String AUTOLOADDIR
           
static java.lang.String CLASS
           
static java.lang.String DESCRIPTORS
          The Ear service configuration properties
protected static java.lang.String JONAS_BASE
          The name of the JONAS_BASE directory.
static java.lang.String PARSINGWITHVALIDATION
           
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
EarServiceImpl()
           
 
Method Summary
 void deployEar(javax.naming.Context ctx)
          Deploy an EAR file with sending JAR file to the EJB container and WAR file to the WEB container and RAR file to the resource service.
 void deployEarMBean(java.lang.String fileName)
          Deploy an EAR by delegating the operation to the deployEar() method.
protected  void doInit(javax.naming.Context ctx)
          Init the EAR service.
protected  void doStart()
          Start the EAR service.
protected  void doStop()
          Stop the EAR service.
 java.lang.Integer getCurrentNumberOfEars()
           
 java.util.Set getEarNames()
          This method is added temporarily.
 void unDeployEar(javax.naming.Context ctx)
          Undeploy an EAR by sending the request to the EJB container and to the WEB container and the Resource service.
 void unDeployEarMBean(java.lang.String fileName)
          Undeploy an EAR by delegating the operation to the unDeployEar() method.
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

JONAS_BASE

protected static final java.lang.String JONAS_BASE
The name of the JONAS_BASE directory.


APPS_DIR

protected static final java.lang.String APPS_DIR
The name of the apps directory.


DESCRIPTORS

public static final java.lang.String DESCRIPTORS
The Ear service configuration properties

See Also:
Constant Field Values

AUTOLOADDIR

public static final java.lang.String AUTOLOADDIR
See Also:
Constant Field Values

PARSINGWITHVALIDATION

public static final java.lang.String PARSINGWITHVALIDATION
See Also:
Constant Field Values

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values
Constructor Detail

EarServiceImpl

public EarServiceImpl()
Method Detail

doInit

protected void doInit(javax.naming.Context ctx)
               throws ServiceException
Init the EAR service.

Specified by:
doInit in class AbsServiceImpl
Parameters:
ctx - the configuration of the Ear service.
Throws:
ServiceException - if the initialization failed.

doStop

protected void doStop()
               throws ServiceException
Stop the EAR service.

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - if the stop failed.

deployEar

public void deployEar(javax.naming.Context ctx)
               throws EarServiceException
Deploy an EAR file with sending JAR file to the EJB container and WAR file to the WEB container and RAR file to the resource service.

Specified by:
deployEar in interface EarService
Parameters:
ctx - the context which contains the configuration in order to deploy an EAR.
Throws:
EarServiceException - if the deployment of the EAR failed.

deployEarMBean

public void deployEarMBean(java.lang.String fileName)
                    throws java.rmi.RemoteException,
                           EarServiceException
Deploy an EAR by delegating the operation to the deployEar() method. This is used for JMX management.

Specified by:
deployEarMBean in interface EarServiceImplMBean
Parameters:
fileName - the fileName of the ear which must be be deployed.
Throws:
java.rmi.RemoteException - if rmi call failed.
EarServiceException - if the deployment of the EAR failed.

doStart

protected void doStart()
                throws ServiceException
Start the EAR service.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - if the startup failed.

unDeployEar

public void unDeployEar(javax.naming.Context ctx)
                 throws EarServiceException
Undeploy an EAR by sending the request to the EJB container and to the WEB container and the Resource service.

Specified by:
unDeployEar in interface EarService
Parameters:
ctx - the context which contains the configuration in order to undeploy an EAR.
Throws:
EarServiceException - if the undeployment of the EAR failed.

unDeployEarMBean

public void unDeployEarMBean(java.lang.String fileName)
                      throws java.rmi.RemoteException,
                             EarServiceException
Undeploy an EAR by delegating the operation to the unDeployEar() method. This is used for JMX management.

Specified by:
unDeployEarMBean in interface EarServiceImplMBean
Parameters:
fileName - the fileName of the ear which must be be undeployed.
Throws:
java.rmi.RemoteException - if rmi call failed.
EarServiceException - if the undeployment of the EAR failed.

getCurrentNumberOfEars

public java.lang.Integer getCurrentNumberOfEars()
Specified by:
getCurrentNumberOfEars in interface EarServiceImplMBean
Returns:
current number of ears deployed in the JOnAS server

getEarNames

public java.util.Set getEarNames()
This method is added temporarily. It will disapear when Ears will have their associated MBeans (when Ears will become manageable)

Specified by:
getEarNames in interface EarServiceImplMBean
Returns:
the names of the ears currently deployed in the JOnAS server