org.objectweb.easybeans.deployable
Class DeployableHelper

java.lang.Object
  extended by org.objectweb.easybeans.deployable.DeployableHelper

public final class DeployableHelper
extends java.lang.Object

Analyze an archive and build the associated Deployable object.
For an .ear file the EARDeployable object will be returned.

Author:
Florent Benoit

Field Summary
private  EZBArchive archive
          Archive used by this helper.
private static java.lang.String CAR_DD
          APP Client XML DD.
private static java.lang.String EAR_DD
          EAR XML DD.
private static java.lang.String EAR_EXTENSION
          EAR extension.
private static java.lang.String EJB_DD
          EJB XML DD.
private static java.lang.String JAR_EXTENSION
          JAR extension.
private static java.lang.String JAVAEE_NS
          Java EE namespace (Java EE).
private static JLog logger
          Logger.
private static java.lang.String MANIFEST_FILE
          Manifest path.
private static java.lang.String RAR_DD
          Rar XML DD.
private static java.lang.String RAR_EXTENSION
          RAR extension.
private static java.lang.String WAR_DD
          Web XML DD.
private static java.lang.String WAR_EXTENSION
          WAR extension.
 
Constructor Summary
private DeployableHelper(EZBArchive archive)
          Utility class, no public constructor.
 
Method Summary
private  EZBDeployable analyze()
          Analyze the URL and create a deployable object.
private  EZBDeployable classDetect()
          Analyze the archive to see if there are some Annotated classes that can find the type of the archive.
private  ArchiveType ejbXMLType()
          Know that the archive is an EJB but needs to analyze the XML in order to see if it is a 2.1 or 3 EJB.
static EZBDeployable getDeployable(EZBArchive archive)
          Gets the Deployable object for the given URL.
private  ArchiveType getXMLType()
          Try to see if there is an XML file in the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EAR_EXTENSION

private static final java.lang.String EAR_EXTENSION
EAR extension.

See Also:
Constant Field Values

WAR_EXTENSION

private static final java.lang.String WAR_EXTENSION
WAR extension.

See Also:
Constant Field Values

RAR_EXTENSION

private static final java.lang.String RAR_EXTENSION
RAR extension.

See Also:
Constant Field Values

JAR_EXTENSION

private static final java.lang.String JAR_EXTENSION
JAR extension.

See Also:
Constant Field Values

MANIFEST_FILE

private static final java.lang.String MANIFEST_FILE
Manifest path.

See Also:
Constant Field Values

EJB_DD

private static final java.lang.String EJB_DD
EJB XML DD.

See Also:
Constant Field Values

WAR_DD

private static final java.lang.String WAR_DD
Web XML DD.

See Also:
Constant Field Values

RAR_DD

private static final java.lang.String RAR_DD
Rar XML DD.

See Also:
Constant Field Values

EAR_DD

private static final java.lang.String EAR_DD
EAR XML DD.

See Also:
Constant Field Values

CAR_DD

private static final java.lang.String CAR_DD
APP Client XML DD.

See Also:
Constant Field Values

JAVAEE_NS

private static final java.lang.String JAVAEE_NS
Java EE namespace (Java EE).

See Also:
Constant Field Values

logger

private static JLog logger
Logger.


archive

private EZBArchive archive
Archive used by this helper.

Constructor Detail

DeployableHelper

private DeployableHelper(EZBArchive archive)
Utility class, no public constructor.

Parameters:
archive - the given archive
Method Detail

getDeployable

public static EZBDeployable getDeployable(EZBArchive archive)
                                   throws DeployableHelperException
Gets the Deployable object for the given URL.

Parameters:
archive - the given archive
Returns:
the Deployable object
Throws:
DeployableHelperException - if the analyze fails

analyze

private EZBDeployable analyze()
                       throws DeployableHelperException
Analyze the URL and create a deployable object.

Returns:
the deployable object
Throws:
DeployableHelperException - if the analyze fails

classDetect

private EZBDeployable classDetect()
                           throws DeployableHelperException
Analyze the archive to see if there are some Annotated classes that can find the type of the archive.

Returns:
a deployable object
Throws:
DeployableHelperException - if the analyze of the classes is failing.

getXMLType

private ArchiveType getXMLType()
                        throws DeployableHelperException
Try to see if there is an XML file in the archive. If it is an EJB XML file, try to get the version.

Returns:
the type of the archive.
Throws:
DeployableHelperException - if the archive can't be analyzed

ejbXMLType

private ArchiveType ejbXMLType()
                        throws DeployableHelperException
Know that the archive is an EJB but needs to analyze the XML in order to see if it is a 2.1 or 3 EJB.

Returns:
EJB 2 or 3 type
Throws:
DeployableHelperException - if the archive can't be analyzed