com.borland.jbuilder.enterprise.ejb
Class DeploymentDescriptor

java.lang.Object
  |
  +--com.borland.jbuilder.enterprise.ejb.DeploymentDescriptor

public class DeploymentDescriptor
extends java.lang.Object

This class represents a single EJB deployment descriptor containing its name (e.g., "ejb-jar.xml"), the timestamp given it when last written to an EJB Group, and it content recorded as an array of bytes.


Field Summary
protected  byte[] bytes
          Array of bytes containing descriptor content.
protected  java.lang.String name
          Name of this descriptor (e.g., "ejb-jar.xml").
protected  long timestamp
          Timestamp of this descriptor, -1 if none yet known.
 
Constructor Summary
DeploymentDescriptor()
          DeploymentDescriptor default constructor.
DeploymentDescriptor(java.lang.String name)
          DeploymentDescriptor constructor.
DeploymentDescriptor(java.lang.String name, long timestamp)
          DeploymentDescriptor constructor.
DeploymentDescriptor(java.lang.String name, long timestamp, byte[] bytes)
          DeploymentDescriptor constructor.
 
Method Summary
 byte[] getBytes()
          Fetches content for this deployment descriptor.
static DeploymentDescriptor[] getDeploymentDescriptors(EJBGRPFileNode ejbGrpNode)
          Returns all deployment descriptors in the given EJB Group file.
 java.lang.String getName()
          Fetches name for this deployment descriptor.
 long getTimestamp()
          Fetches timestamp for this deployment descriptor.
 void setBytes(byte[] newBytes)
          Updates content of this deployment descriptor.
 void setName(java.lang.String newName)
          Updates name of this deployment descriptor.
 void setTimestamp(long newTimestamp)
          Updates timestamp on this deployment descriptor.
 java.lang.String toString()
          Converts any content into a string, translating bytes into characters according to the platform default character encoding.
 java.lang.String toString(java.lang.String enc)
          Converts any content into a string, translating bytes into characters according to the specified character encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name of this descriptor (e.g., "ejb-jar.xml").

timestamp

protected long timestamp
Timestamp of this descriptor, -1 if none yet known.

bytes

protected byte[] bytes
Array of bytes containing descriptor content.
Constructor Detail

DeploymentDescriptor

public DeploymentDescriptor()
DeploymentDescriptor default constructor.

DeploymentDescriptor

public DeploymentDescriptor(java.lang.String name)
DeploymentDescriptor constructor.
Parameters:
name - Name of this descriptor (e.g., "ejb-jar.xml").

DeploymentDescriptor

public DeploymentDescriptor(java.lang.String name,
                            long timestamp)
DeploymentDescriptor constructor.
Parameters:
name - Name of this descriptor (e.g., "ejb-jar.xml").
timestamp - Timestamp of this descriptor, -1 if none yet known.

DeploymentDescriptor

public DeploymentDescriptor(java.lang.String name,
                            long timestamp,
                            byte[] bytes)
DeploymentDescriptor constructor.
Parameters:
name - Name of this descriptor (e.g., "ejb-jar.xml").
timestamp - Timestamp of this descriptor, -1 if none yet known.
bytes - Array of bytes containing descriptor content.
Method Detail

setTimestamp

public void setTimestamp(long newTimestamp)
Updates timestamp on this deployment descriptor.
Parameters:
newTimestamp - Updated timestamp.

getTimestamp

public long getTimestamp()
Fetches timestamp for this deployment descriptor.
Returns:
Returns timestamp, -1 if none yet set.

setName

public void setName(java.lang.String newName)
Updates name of this deployment descriptor.
Parameters:
newName - Updated name.

getName

public java.lang.String getName()
Fetches name for this deployment descriptor.
Returns:
Returns name, null if none yet set.

setBytes

public void setBytes(byte[] newBytes)
Updates content of this deployment descriptor.
Parameters:
newBytes - Updated content.

getBytes

public byte[] getBytes()
Fetches content for this deployment descriptor.
Returns:
Returns content as array of bytes.

toString

public java.lang.String toString()
Converts any content into a string, translating bytes into characters according to the platform default character encoding.
Overrides:
toString in class java.lang.Object
Returns:
String translated from the content.

toString

public java.lang.String toString(java.lang.String enc)
                          throws java.io.UnsupportedEncodingException
Converts any content into a string, translating bytes into characters according to the specified character encoding.
Parameters:
enc - a character-encoding name.
Returns:
String translated from the content.
Throws:
java.io.UnsupportedEncodingException - If given encoding is not supported.

getDeploymentDescriptors

public static DeploymentDescriptor[] getDeploymentDescriptors(EJBGRPFileNode ejbGrpNode)
Returns all deployment descriptors in the given EJB Group file.
Parameters:
ejbGrpNode - The EJB Group file node.
Returns:
Array of deployment descriptors to be jar'ed or null if none.