org.ow2.jonas.cdi.weld.internal
Class DefaultWeldService

java.lang.Object
  extended by org.ow2.jonas.lib.management.javaee.ManagedObject
      extended by org.ow2.jonas.lib.service.AbsServiceImpl
          extended by org.ow2.jonas.cdi.weld.internal.DefaultWeldService
All Implemented Interfaces:
IWeldService, Service

public class DefaultWeldService
extends AbsServiceImpl
implements IWeldService

Weld CDI service implementation.

Author:
Guillaume Sauthier

Constructor Summary
DefaultWeldService()
           
 
Method Summary
 void connectBeanDeploymentArchives(Collection<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive> childs, Collection<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive> parents)
          Connects all the BDA in the first Collection to each BDA in the second Collection.
protected  void doStart()
          Abstract start-up method to be implemented by sub-classes.
protected  void doStop()
          Abstract method for service stopping to be implemented by sub-classes.
 boolean isCdiEnabled(org.ow2.util.archive.api.IArchive archive)
          Detect if the given IArchive contains a beans.xml.
 org.jboss.weld.bootstrap.api.Bootstrap startWeldContainer(org.jboss.weld.bootstrap.spi.Deployment deployment)
          Starts a Weld container from a given Weld Deployment.
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getSequenceNumber, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.management.javaee.ManagedObject
getModelMBean, sendNotification, sendReconfigNotification, sendSaveNotification, setModelMBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultWeldService

public DefaultWeldService()
Method Detail

doStart

protected void doStart()
                throws ServiceException
Abstract start-up method to be implemented by sub-classes.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - service start-up failed

doStop

protected void doStop()
               throws ServiceException
Abstract method for service stopping to be implemented by sub-classes.

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - service stopping failed

isCdiEnabled

public boolean isCdiEnabled(org.ow2.util.archive.api.IArchive archive)
Detect if the given IArchive contains a beans.xml. Checked location includes:

Specified by:
isCdiEnabled in interface IWeldService
Parameters:
archive - explored archive
Returns:
true if the given archive is CDI enabled, false otherwise.

connectBeanDeploymentArchives

public void connectBeanDeploymentArchives(Collection<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive> childs,
                                          Collection<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive> parents)
Connects all the BDA in the first Collection to each BDA in the second Collection. That makes beans from the second Collection (aka parent) accessible from the beans defined in the first Collection (childs).

Specified by:
connectBeanDeploymentArchives in interface IWeldService
Parameters:
childs - Collection of BDAs
parents - Collection of BDAs that will be accessibles from childs

startWeldContainer

public org.jboss.weld.bootstrap.api.Bootstrap startWeldContainer(org.jboss.weld.bootstrap.spi.Deployment deployment)
Starts a Weld container from a given Weld Deployment.

Specified by:
startWeldContainer in interface IWeldService
Parameters:
deployment - Weld deployment interface
Returns:
a started Weld Bootstrap


Copyright © 2011 OW2 Consortium. All Rights Reserved.