org.netbeans.modules.j2eeserver/4 1.89.0 1

org.netbeans.modules.j2ee.deployment.devmodules.api
Class J2eeModule

java.lang.Object
  extended by org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule
Direct Known Subclasses:
J2eeApplication

public class J2eeModule
extends Object

Abstraction of J2EE module. Provides access to basic server-neutral properties of the modules: J2EE version, module type, deployment descriptor.

It is not possible to instantiate this class directly. Implementators have to implement the J2eeModuleImplementation first and then use the J2eeModuleFactory to create a J2eeModule instance.


Nested Class Summary
static interface J2eeModule.RootedEntry
           
static class J2eeModule.Type
           
 
Field Summary
static String APP_XML
           
static Object CLIENT
          Deprecated. use J2eeModule.Type.CAR
static String CLIENT_XML
           
static Object CONN
          Deprecated. use J2eeModule.Type.RAR
static String CONNECTOR_XML
           
static Object EAR
          Deprecated. use J2eeModule.Type.EAR
static Object EJB
          Deprecated. use J2eeModule.Type.EJB
static String EJBJAR_XML
           
static String EJBSERVICES_XML
           
static String J2EE_13
          Deprecated. use Profile#J2EE_13
static String J2EE_14
          Deprecated. use Profile#J2EE_14
static String JAVA_EE_5
          Deprecated. use Profile#JAVA_EE_5
static String MIME_J2EE_MODULE_TARGET
          MIME type for ContentDescriptor of build targets that have J2eeModule in lookup.
static String PROP_MODULE_VERSION
          Module version property
static String PROP_RESOURCE_DIRECTORY
          Enterprise resorce directory property
static Object WAR
          Deprecated. use J2eeModule.Type.WAR
static String WEB_XML
           
static String WEBSERVICES_XML
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 FileObject getArchive()
          Returns the archive file for the module of null if the archive file does not exist (for example, has not been compiled yet).
 Iterator<J2eeModule.RootedEntry> getArchiveContents()
          Returns the contents of the archive, in copyable form.
 FileObject getContentDirectory()
          This call is used in in-place deployment.
 File getDeploymentConfigurationFile(String name)
          Returns source deployment configuration file path for the given deployment configuration file path name, for example (but not only) WEB-INF/sun-web.xml or META-INF/context.xml.
<T> MetadataModel<T>
getMetadataModel(Class<T> type)
          Returns a metadata model of a deployment descriptor specified by the type parameter.
 Object getModuleType()
          Deprecated. use getType()
 String getModuleVersion()
          Returns a Java EE module specification version, version of a web application for example.
 File getResourceDirectory()
          Returns the module resource directory or null if the module has no resource directory.
 J2eeModule.Type getType()
          Returns module type.
 String getUrl()
          Returns the location of the module within the application archive.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_J2EE_MODULE_TARGET

public static final String MIME_J2EE_MODULE_TARGET
MIME type for ContentDescriptor of build targets that have J2eeModule in lookup. This can be used to search implementations of targets providing J2eeModule in project's ContainersList.

See Also:
Constant Field Values

EAR

public static final Object EAR
Deprecated. use J2eeModule.Type.EAR
The module is an EAR archive.


WAR

public static final Object WAR
Deprecated. use J2eeModule.Type.WAR
The module is an Web Application archive.


EJB

public static final Object EJB
Deprecated. use J2eeModule.Type.EJB
The module is an Enterprise Java Bean archive.


CONN

public static final Object CONN
Deprecated. use J2eeModule.Type.RAR
The module is an Connector archive.


CLIENT

public static final Object CLIENT
Deprecated. use J2eeModule.Type.CAR
The module is an Client Application archive.


J2EE_13

public static final String J2EE_13
Deprecated. use Profile#J2EE_13
J2EE specification version 1.3

Since:
1.5
See Also:
Constant Field Values

J2EE_14

public static final String J2EE_14
Deprecated. use Profile#J2EE_14
J2EE specification version 1.4

Since:
1.5
See Also:
Constant Field Values

JAVA_EE_5

public static final String JAVA_EE_5
Deprecated. use Profile#JAVA_EE_5
JAVA EE 5 specification version

Since:
1.6
See Also:
Constant Field Values

APP_XML

public static final String APP_XML
See Also:
Constant Field Values

WEB_XML

public static final String WEB_XML
See Also:
Constant Field Values

WEBSERVICES_XML

public static final String WEBSERVICES_XML
See Also:
Constant Field Values

EJBJAR_XML

public static final String EJBJAR_XML
See Also:
Constant Field Values

EJBSERVICES_XML

public static final String EJBSERVICES_XML
See Also:
Constant Field Values

CONNECTOR_XML

public static final String CONNECTOR_XML
See Also:
Constant Field Values

CLIENT_XML

public static final String CLIENT_XML
See Also:
Constant Field Values

PROP_RESOURCE_DIRECTORY

public static final String PROP_RESOURCE_DIRECTORY
Enterprise resorce directory property

See Also:
Constant Field Values

PROP_MODULE_VERSION

public static final String PROP_MODULE_VERSION
Module version property

See Also:
Constant Field Values
Method Detail

getModuleVersion

@NonNull
public String getModuleVersion()
Returns a Java EE module specification version, version of a web application for example.

Do not confuse with the Java EE platform specification version.

Returns:
module specification version.

getModuleType

@NonNull
public Object getModuleType()
Deprecated. use getType()

Returns module type.

Returns:
module type.

getType

@NonNull
public J2eeModule.Type getType()
Returns module type.

Returns:
module type
Since:
1.59

getUrl

public String getUrl()
Returns the location of the module within the application archive.

Returns:
location of the module within the application archive.

getArchive

public FileObject getArchive()
                      throws IOException
Returns the archive file for the module of null if the archive file does not exist (for example, has not been compiled yet).

Throws:
IOException

getArchiveContents

public Iterator<J2eeModule.RootedEntry> getArchiveContents()
                                                    throws IOException
Returns the contents of the archive, in copyable form. Used for incremental deployment. Currently uses its own J2eeModule.RootedEntry interface. If the J2eeModule instance describes a j2ee application, the result should not contain module archives.

Returns:
entries
Throws:
IOException

getContentDirectory

public FileObject getContentDirectory()
                               throws IOException
This call is used in in-place deployment. Returns the directory staging the contents of the archive This directory is the one from which the content entries returned by getArchiveContents() came from.

Returns:
FileObject for the content directory, return null if the module doesn't have a build directory, like an binary archive project
Throws:
IOException

getMetadataModel

public <T> MetadataModel<T> getMetadataModel(Class<T> type)
Returns a metadata model of a deployment descriptor specified by the type parameter.

As an example, passing org.netbeans.modules.j2ee.dd.api.web.WebAppMetadata.class as a type parameter will return a metadata model of the web module deployment descriptor - web.xml.

Parameters:
type - metadata model type class for which a MetadataModel instance will be returned.
Returns:
metadata model of a deployment descriptor specified by the type parameter.
Throws:
NullPointerException - if the type parameter is null.

getResourceDirectory

public File getResourceDirectory()
Returns the module resource directory or null if the module has no resource directory.

Returns:
the module resource directory or null if the module has no resource directory.

getDeploymentConfigurationFile

public File getDeploymentConfigurationFile(String name)
Returns source deployment configuration file path for the given deployment configuration file path name, for example (but not only) WEB-INF/sun-web.xml or META-INF/context.xml.

Parameters:
name - file name of the deployment configuration file, WEB-INF/sun-web.xml for example.
Returns:
absolute path to the deployment configuration file, or null if the specified file name is not known to this J2eeModule.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.

Parameters:
listener - PropertyChangeListener

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.

Parameters:
listener - PropertyChangeListener

org.netbeans.modules.j2eeserver/4 1.89.0 1

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.