org.ow2.jonas.ear.internal
Class JOnASEARService

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.ear.internal.JOnASEARService
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, EarService, JOnASEARServiceMBean, Service

public class JOnASEARService
extends AbsServiceImpl
implements EarService, JOnASEARServiceMBean

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

Author:
Florent Benoit, Ludovic Bert, Francois Fornaciari Contributor(s): Adriana Danes: highlight configuration properties Eric Hardesty: added ability to include rar files in an ear Michel-Ange Anton : new JSR77 MBean S. Ali Tokmen (versioning)

Field Summary
protected static String WORK_APPS_DIR
          The name of the working apps directory.
protected static String WORK_DIR
          The name of the working directory.
 
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
JOnASEARService()
          Initialize some Maps at instantiation time.
 
Method Summary
protected  void doStart()
          Start the EAR service.
protected  void doStop()
          Stop the EAR service.
 List<String> getDeployedEars()
          Return the list of all deployed applications.
 Integer getDeployedEARsNumber()
          Returns the number of EARs deployed in the JOnAS server.
 VersioningService getVersioningService()
           
protected  void initWorkingDirectory()
          Create working directory for applications.
 boolean isEarDeployedByWorkName(String unpackName)
          Test if the specified unpack name is already deployed or not.
 boolean isEarLoaded(String fileName)
          Test if the specified filename is already deployed or not.
 void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
           
 void setEasyBeansService(IEasyBeansService service)
           
 void setEjbService(EJBService ejbService)
           
 void setGenstub(boolean isEnabled)
           
 void setJAXRPCService(IJAXRPCService jaxrpcService)
           
 void setJmxService(JmxService jmxService)
           
 void setParsingwithvalidation(boolean validate)
           
 void setResourceService(ResourceService resourceService)
           
 void setServiceManager(ServiceManager serviceManager)
          Sets tThe service manager.
 void setVersioningService(VersioningService versioningService)
           
 void setWebContainerService(JWebContainerService webContainerService)
           
protected  void setWorkCleanerService(WorkCleanerService workCleanerService)
          Method called when the workCleanerService is bound to the component.
 void unsetDeployerManager()
          Unbind the IDeployerManager.
 void unsetEasyBeansService()
          Unbind the IEasyBeansService.
 void unsetEjbService()
          Unbind the EJBService.
 void unsetJAXRPCService()
          Unbind the IJAXRPCService.
 void unsetResourceService()
          Unbind the ResourceService.
 void unsetServiceManager()
          Sets the service manager to null.
 void unsetVersioningService()
          Sets the versioning service to null.
 void unsetWebContainerService()
          Unbind the JWebContainerService.
 void useEJB3ChildClassloader(boolean isEnabled)
          Enable the use of a child classloader for EJB3s.
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

WORK_DIR

protected static final String WORK_DIR
The name of the working directory.


WORK_APPS_DIR

protected static final String WORK_APPS_DIR
The name of the working apps directory.

Constructor Detail

JOnASEARService

public JOnASEARService()
Initialize some Maps at instantiation time.

Method Detail

setParsingwithvalidation

public void setParsingwithvalidation(boolean validate)
Parameters:
validate - Use a validating parser ?

setGenstub

public void setGenstub(boolean isEnabled)
Parameters:
isEnabled - if generation of stubs need to be enabled ?

useEJB3ChildClassloader

public void useEJB3ChildClassloader(boolean isEnabled)
Enable the use of a child classloader for EJB3s.

Parameters:
isEnabled - if EJB3 neeeds a child class loader

doStop

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

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

doStart

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

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

initWorkingDirectory

protected void initWorkingDirectory()
Create working directory for applications.


setWorkCleanerService

protected void setWorkCleanerService(WorkCleanerService workCleanerService)
Method called when the workCleanerService is bound to the component.

Parameters:
workCleanerService - the workCleanerService reference

getDeployedEars

public List<String> getDeployedEars()
Return the list of all deployed applications.

Specified by:
getDeployedEars in interface JOnASEARServiceMBean
Returns:
The list of deployed applications

getDeployedEARsNumber

public Integer getDeployedEARsNumber()
Description copied from interface: JOnASEARServiceMBean
Returns the number of EARs deployed in the JOnAS server.

Specified by:
getDeployedEARsNumber in interface JOnASEARServiceMBean
Returns:
current number of ears deployed in the JOnAS server

isEarLoaded

public boolean isEarLoaded(String fileName)
Test if the specified filename is already deployed or not. This method is a management method provided by the EarServerice MBean.

Specified by:
isEarLoaded in interface JOnASEARServiceMBean
Parameters:
fileName - the name of the ear file.
Returns:
true if the ear is deployed, else false.

isEarDeployedByWorkName

public boolean isEarDeployedByWorkName(String unpackName)
Test if the specified unpack name is already deployed or not. This method is defined in the EarService interface.

Specified by:
isEarDeployedByWorkName in interface EarService
Parameters:
unpackName - the name of the ear file.
Returns:
true if the ear is deployed, else false.

setJmxService

public void setJmxService(JmxService jmxService)
Parameters:
jmxService - the jmxService to set

setEjbService

public void setEjbService(EJBService ejbService)
Parameters:
ejbService - the ejbService to set

unsetEjbService

public void unsetEjbService()
Unbind the EJBService.


setWebContainerService

public void setWebContainerService(JWebContainerService webContainerService)
Parameters:
webContainerService - the webContainerService to set

unsetWebContainerService

public void unsetWebContainerService()
Unbind the JWebContainerService.


setJAXRPCService

public void setJAXRPCService(IJAXRPCService jaxrpcService)
Parameters:
jaxrpcService - the jaxrpcService to set

unsetJAXRPCService

public void unsetJAXRPCService()
Unbind the IJAXRPCService.


setResourceService

public void setResourceService(ResourceService resourceService)
Parameters:
resourceService - the resourceService to set

unsetResourceService

public void unsetResourceService()
Unbind the ResourceService.


setEasyBeansService

public void setEasyBeansService(IEasyBeansService service)
Parameters:
service - the EJB3 Service to be injected.

unsetEasyBeansService

public void unsetEasyBeansService()
Unbind the IEasyBeansService.


setDeployerManager

public void setDeployerManager(org.ow2.util.ee.deploy.api.deployer.IDeployerManager deployerManager)
Parameters:
deployerManager - the deployerManager to set

unsetDeployerManager

public void unsetDeployerManager()
Unbind the IDeployerManager.


setVersioningService

public void setVersioningService(VersioningService versioningService)
Parameters:
versioningService - The versioning service to set.

unsetVersioningService

public void unsetVersioningService()
Sets the versioning service to null.


getVersioningService

public VersioningService getVersioningService()
Returns:
The versioning service.

setServiceManager

public void setServiceManager(ServiceManager serviceManager)
Sets tThe service manager.


unsetServiceManager

public void unsetServiceManager()
Sets the service manager to null.



Copyright © 2010 OW2 Consortium. All Rights Reserved.