org.jboss.hibernate.har
Class HARDeployer

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.deployment.SubDeployerSupport (src) 
              extended byorg.jboss.hibernate.har.HARDeployer
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src) , SubDeployer (src)

public class HARDeployer
extends SubDeployerSupport (src)

Deployer for Hibernate har archives. A Hibernate archive is expected to have a .har extension and include:


Nested Class Summary
 
Nested classes inherited from class org.jboss.deployment.SubDeployerSupport (src)
SubDeployerSupport.ClassConfiguration (src)
 
Field Summary
 
Fields inherited from class org.jboss.deployment.SubDeployerSupport (src)
CONFIGURATION, mainDeployer, nativePrefix, nativeSuffix, relativeOrder, suffixes, tempDeployDir
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.deployment.SubDeployer (src)
CREATE_NOTIFICATION, DESTROY_NOTIFICATION, INIT_NOTIFICATION, RELATIVE_ORDER_100, RELATIVE_ORDER_200, RELATIVE_ORDER_300, RELATIVE_ORDER_400, RELATIVE_ORDER_500, RELATIVE_ORDER_600, RELATIVE_ORDER_700, RELATIVE_ORDER_800, RELATIVE_ORDER_900, START_NOTIFICATION, STOP_NOTIFICATION
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
HARDeployer()
          Default CTOR used to set default values to the Suffixes and RelativeOrder attributes.
 
Method Summary
 boolean accepts(DeploymentInfo (src)  di)
          The HARDeployer accepts either archives ending in '.har' or exploded directories (with name ending in '.har/').
 void create(DeploymentInfo (src)  di)
          Sub-classes should override this method to provide custom 'create' logic.
protected  void deployUrl(DeploymentInfo (src)  di, java.net.URL url, java.lang.String name)
           
 void destroy(DeploymentInfo (src)  di)
          Sub-classes should override this method to provide custom 'destroy' logic.
 java.util.Iterator getDeployedApplications()
          Returns the deployed applications.
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 boolean getValidateDTDs()
          Get the flag indicating that ejb-jar.dtd, jboss.dtd & jboss-web.dtd conforming documents should be validated against the DTD.
 void init(DeploymentInfo (src)  di)
          Initialize the given deployment.
 boolean isDeployable(java.lang.String name, java.net.URL url)
          This method returns true if the name is a recognized archive file.
protected  void processNestedDeployments(DeploymentInfo (src)  di)
          The processNestedDeployments method searches for any nested and deployable elements.
 void setValidateDTDs(boolean validate)
          Set the flag indicating that ejb-jar.dtd, jboss.dtd & jboss-web.dtd conforming documents should be validated against the DTD.
 void start(DeploymentInfo (src)  di)
          Sub-classes should override this method to provide custom 'start' logic.
protected  void startService()
          Get a reference to the ServiceController
 void stop(DeploymentInfo (src)  di)
          Sub-classes should override this method to provide custom 'stop' logic.
protected  void stopService()
          Implements the template method in superclass.
 
Methods inherited from class org.jboss.deployment.SubDeployerSupport (src)
addDeployableFiles, addDeployableJar, createService, destroyService, emitNotification, getRelativeOrder, getSuffixes, setRelativeOrder, setSuffixes
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployment.SubDeployer (src)
getServiceName
 

Constructor Detail

HARDeployer

public HARDeployer()
Default CTOR used to set default values to the Suffixes and RelativeOrder attributes. Those are read at subdeployer registration time by the MainDeployer to alter its SuffixOrder.

Method Detail

getDeployedApplications

public java.util.Iterator getDeployedApplications()
Returns the deployed applications.


getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

startService

protected void startService()
                     throws java.lang.Exception
Get a reference to the ServiceController

Overrides:
startService in class SubDeployerSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Implements the template method in superclass. This method stops all the applications in this server.

Overrides:
stopService in class SubDeployerSupport (src)
Throws:
java.lang.Exception

getValidateDTDs

public boolean getValidateDTDs()
Get the flag indicating that ejb-jar.dtd, jboss.dtd & jboss-web.dtd conforming documents should be validated against the DTD.


setValidateDTDs

public void setValidateDTDs(boolean validate)
Set the flag indicating that ejb-jar.dtd, jboss.dtd & jboss-web.dtd conforming documents should be validated against the DTD.


processNestedDeployments

protected void processNestedDeployments(DeploymentInfo (src)  di)
                                 throws DeploymentException (src) 
Description copied from class: SubDeployerSupport (src)
The processNestedDeployments method searches for any nested and deployable elements. Only Directories and Zipped archives are processed, and those are delegated to the addDeployableFiles and addDeployableJar methods respectively. This method can be overridden for alternate behaviour.

Overrides:
processNestedDeployments in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

deployUrl

protected void deployUrl(DeploymentInfo (src)  di,
                         java.net.URL url,
                         java.lang.String name)
                  throws DeploymentException (src) 
Overrides:
deployUrl in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

isDeployable

public boolean isDeployable(java.lang.String name,
                            java.net.URL url)
Description copied from class: SubDeployerSupport (src)
This method returns true if the name is a recognized archive file. It will query the MainDeployer that keeps a dynamically updated list of known archive extensions.

Overrides:
isDeployable in class SubDeployerSupport (src)
Parameters:
name - The "short-name" of the URL. It will have any trailing '/' characters removed, and any directory structure has been removed.
url - The full url.
Returns:
true iff the name ends in a known archive extension: .jar, .sar, .ear, .rar, .zip, .wsr, .war, or if the name matches the native library conventions.

accepts

public boolean accepts(DeploymentInfo (src)  di)
The HARDeployer accepts either archives ending in '.har' or exploded directories (with name ending in '.har/'). Furthermore, the deployment must contain a file named 'META-INF/hibernate-service.xml' in order to be accepted.

Parameters:
di - The deployment info for the deployment to be checked for acceptance.
Returns:
True if the conditions mentioned above hold true; false otherwise.

init

public void init(DeploymentInfo (src)  di)
          throws DeploymentException (src) 
Initialize the given deployment. Overriden to perform custom watch logic.

Specified by:
init in interface SubDeployer (src)
Overrides:
init in class SubDeployerSupport (src)
Parameters:
di - The deployment to be initialized.
Throws:
DeploymentException (src)

create

public void create(DeploymentInfo (src)  di)
            throws DeploymentException (src) 
Description copied from class: SubDeployerSupport (src)
Sub-classes should override this method to provide custom 'create' logic. This method issues a JMX notification of type SubDeployer.CREATE_NOTIFICATION.

Specified by:
create in interface SubDeployer (src)
Overrides:
create in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

start

public void start(DeploymentInfo (src)  di)
           throws DeploymentException (src) 
Description copied from class: SubDeployerSupport (src)
Sub-classes should override this method to provide custom 'start' logic. This method issues a JMX notification of type SubDeployer.START_NOTIFICATION.

Specified by:
start in interface SubDeployer (src)
Overrides:
start in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

stop

public void stop(DeploymentInfo (src)  di)
          throws DeploymentException (src) 
Description copied from class: SubDeployerSupport (src)
Sub-classes should override this method to provide custom 'stop' logic. This method issues a JMX notification of type SubDeployer.START_NOTIFICATION.

Specified by:
stop in interface SubDeployer (src)
Overrides:
stop in class SubDeployerSupport (src)
Throws:
DeploymentException (src)

destroy

public void destroy(DeploymentInfo (src)  di)
             throws DeploymentException (src) 
Description copied from class: SubDeployerSupport (src)
Sub-classes should override this method to provide custom 'destroy' logic. This method issues a JMX notification of type SubDeployer.DESTROY_NOTIFICATION.

Specified by:
destroy in interface SubDeployer (src)
Overrides:
destroy in class SubDeployerSupport (src)
Throws:
DeploymentException (src)