|
J2EE1.4 SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides facilities to deploy any type of J2EE module. Users of this interface are likely to do the following
- Start uploading the necessary file for deployment by using the initiateFileUpload and sendBytes APIs. Once the file(s) upload are completed the deploy operation can be initiated.
- Instead of uploading files or when dealing with redeployment with a partial archive delivery, a DeploymentSource object is used to retrieve the delivered files. This DeploymentSource is encoded as a Map.
- Deploy operations can be invoked either by using uploaded files ID (obtained from initiateFileUpload) or a DeploymentSource. DeploymentOptions can be passed as a Map of Deployment option name to deployment option value.
- Deploy operations are asynchronous therefore they can be monitored using the getDeploymentProgress and getStatusCode operations.- To observe completion of a deployment, the client should register itself as a listener on the DeploymentMgr using addNotificationListener(). A Notification will be issued in which the value of notif.getUserData() will be the deployID used for the deployment. The notif will have the getType() of DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE.
- In case the client wants to retrieve non portable artifacts after successful deployment the file download APIs should be used (initiateFileDownload and receiveBytes).
MBean API's concept of Deploy and Undeploy are different from the CLI and GUI concept. In order to have a fully functioning application for deploy or a fully removed application for undeploy, 3 steps must be performed in both cases. Associate and start (also, stop and disassociate) are always performed together in CLI and GUI. MBean API users must perform the 3 steps explicitly. I.e. Deploy and Undeploy in the MBean API performs only the transfer and registration of files in the AppServer.
These are the required steps:
DeployAlso, J2EEServer.getDeployedObjectsSet() is based on a running modules. Hence, a deployedObject will appear in the list only when the module is running
Field Summary | |
static java.lang.String |
DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
Key for startDeploy) options-- This option controls whether availability is enabled for SFSB checkpointing (and potentially passivation). |
static java.lang.String |
DEPLOY_OPTION_CASCADE_KEY
Key for undeploy() options-- If set to true, it deletes all the connection pools and connector resources associated with the resource adapter (being undeployed). |
static java.lang.String |
DEPLOY_OPTION_CONTEXT_ROOT_KEY
Key for startDeploy) options-- The context root of the deployable web component. |
static java.lang.String |
DEPLOY_OPTION_DESCRIPTION_KEY
Key for startDeploy) options-- The description of the component being deployed. |
static java.lang.String |
DEPLOY_OPTION_ENABLE_KEY
Key for startDeploy) options-- Disables or enables the component after it is deployed. |
static java.lang.String |
DEPLOY_OPTION_FORCE_KEY
Key for startDeploy() options-- Forcefully (re)deploy the component even if the specified component has already been deployed. |
static java.lang.String |
DEPLOY_OPTION_GENERATE_RMI_STUBS_KEY
Key for startDeploy) options-- When true, will generate the static RMI-IIOP stubs and put it in the client.jar. |
static java.lang.String |
DEPLOY_OPTION_NAME_KEY
Key for startDeploy) options-- Registration name of the deployble component, its value should be unique across domain. |
static java.lang.String |
DEPLOY_OPTION_VERIFY_KEY
Key for startDeploy() options-- If set to true, verify the syntax and semantics of the deployment descriptor. |
static java.lang.String |
DEPLOYMENT_ABORTED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment is aborted via abortDeploy(). |
static java.lang.String |
DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment completes. |
static java.lang.String |
DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE
The type of the Notification emitted for deployment progress. |
static java.lang.String |
DEPLOYMENT_STARTED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment starts. |
static java.lang.String |
J2EE_TYPE
The j2eeType as returned by AMX.getJ2EEType() . |
static java.lang.String |
KEY_PREFIX
Prefix for all keys used by DeploymentMgr |
static int |
MAX_DOWNLOAD_CHUNK_SIZE
The maximum allowed transfer size for downloading. |
static java.lang.String |
NOTIF_DEPLOYMENT_COMPLETED_STATUS_KEY
Key within the Map of a Notification of type DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE, indicating the final status of the deployment. |
static java.lang.String |
NOTIF_DEPLOYMENT_ID_KEY
Key within the Map of a Notification indicating deployment ID. |
static java.lang.String |
NOTIF_DEPLOYMENT_PROGRESS_KEY
Key within the Map of a Notification of type DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE, indicating a DeploymentProgress, as a Map. |
static java.lang.String |
STUBS_JARFILENAME
|
Fields inherited from interface com.sun.appserv.management.base.AMX |
FULL_TYPE_DELIM, GROUP_CONFIGURATION, GROUP_JSR77, GROUP_MONITORING, GROUP_OTHER, GROUP_UTILITY, J2EE_TYPE_KEY, NAME_KEY, NO_NAME, NULL_NAME |
Fields inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
LOG_RECORD_KEY, LOG_RECORD_NOTIFICATION_TYPE |
Method Summary | |
boolean |
abortDeploy(java.lang.Object deployID)
abort a given deployment operation, all modification to the server must be rollbacked and all resources cleaned. |
byte[] |
downloadBytes(java.lang.Object downloadID,
int requestSize)
Download byte chunks from the server using a file operation id obtained via initiateFileDownload API. |
long |
getDownloadLength(java.lang.Object downloadID)
Get the total length the download will be, in bytes. |
java.util.Map |
getFinalDeploymentStatus(java.lang.Object deployID)
Return the final DeploymentStatus once the deployment has finished. |
java.lang.Object |
initDeploy()
Create a new deploy ID which may be used via startDeploy() to start a new deployment operation. |
java.lang.Object |
initiateFileDownload(java.lang.String moduleID,
java.lang.String fileName)
Initiates a file download with the given filename. |
java.lang.Object |
initiateFileUpload(long totalSize)
initiatiate a new deployment operation, the id returned will be used to transfer the appropriate files on the server. |
void |
startDeploy(java.lang.Object deployID,
java.util.Map source,
java.util.Map plan,
java.util.Map options)
Start a new deployment operation given a deployment source and a list of options. |
void |
startDeploy(java.lang.Object deployID,
java.lang.Object uploadID,
java.lang.Object planUploadID,
java.util.Map options)
Start the deployment operation using file(s) previously uploaded by initializeFileUpload() and uploadBytes(). |
Notification[] |
takeNotifications(java.lang.Object deployID)
Return all Notifications, which have already been sent, but which are also queued waiting for this request. |
java.util.Map |
undeploy(java.lang.String moduleID,
java.util.Map optionalParams)
Undeploys a module or application from the server, cleans all associated resources and removed the module from the list of installed components. |
boolean |
uploadBytes(java.lang.Object uploadID,
byte[] bytes)
For an upload id obtained from initiateFileUpload(), send another chunk of bytes for that upload. |
Methods inherited from interface com.sun.appserv.management.base.AMX |
getContainer, getDomainRoot, getFullType, getGroup, getJ2EEType, getName |
Methods inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
getMBeanEmitLogNotifications, getMBeanLoggerName, getMBeanLogLevel, setMBeanEmitLogNotifications, setMBeanLogLevel |
Methods inherited from interface javax.management.NotificationEmitter |
removeNotificationListener |
Methods inherited from interface javax.management.NotificationBroadcaster |
addNotificationListener, getNotificationInfo, removeNotificationListener |
Field Detail |
public static final java.lang.String J2EE_TYPE
AMX.getJ2EEType()
.
public static final java.lang.String KEY_PREFIX
public static final java.lang.String NOTIF_DEPLOYMENT_ID_KEY
public static final java.lang.String NOTIF_DEPLOYMENT_COMPLETED_STATUS_KEY
public static final java.lang.String NOTIF_DEPLOYMENT_PROGRESS_KEY
public static final java.lang.String DEPLOYMENT_STARTED_NOTIFICATION_TYPE
public static final java.lang.String DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE
public static final java.lang.String DEPLOYMENT_ABORTED_NOTIFICATION_TYPE
public static final java.lang.String DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE
public static final java.lang.String STUBS_JARFILENAME
public static final java.lang.String DEPLOY_OPTION_FORCE_KEY
public static final java.lang.String DEPLOY_OPTION_CASCADE_KEY
This option is applicable to connectors(resource adapters) and applications(J2EE apps i.e .ear files can contain the resource adapters *.rar). The default value is false.
public static final java.lang.String DEPLOY_OPTION_VERIFY_KEY
public static final java.lang.String DEPLOY_OPTION_ENABLE_KEY
public static final java.lang.String DEPLOY_OPTION_CONTEXT_ROOT_KEY
public static final java.lang.String DEPLOY_OPTION_NAME_KEY
public static final java.lang.String DEPLOY_OPTION_DESCRIPTION_KEY
public static final java.lang.String DEPLOY_OPTION_GENERATE_RMI_STUBS_KEY
public static final java.lang.String DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
public static final int MAX_DOWNLOAD_CHUNK_SIZE
Method Detail |
public java.lang.Object initiateFileUpload(long totalSize) throws java.io.IOException
totalSize
- total size of the file to upload
java.io.IOException
public boolean uploadBytes(java.lang.Object uploadID, byte[] bytes) throws java.io.IOException
uploadID
- the id obtained from initiateFileUpload()bytes
- the bytes to upload
java.io.IOException
public java.lang.Object initDeploy()
public void startDeploy(java.lang.Object deployID, java.lang.Object uploadID, java.lang.Object planUploadID, java.util.Map options)
When the runtime deployment descriptors and other server specific configuration are embedded in the deployable archive, null should be passed for the planUploadID.
Legal keys for use within the options Map include:
DEPLOY_OPTION_FORCE_KEY
DEPLOY_OPTION_CASCADE_KEY
DEPLOY_OPTION_VERIFY_KEY
DEPLOY_OPTION_ENABLE_KEY
DEPLOY_OPTION_CONTEXT_ROOT_KEY
DEPLOY_OPTION_NAME_KEY
DEPLOY_OPTION_DESCRIPTION_KEY
DEPLOY_OPTION_GENERATE_RMI_STUBS_KEY
DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
deployID
- an id obtained from initDeploy()uploadID
- an id obtained from initiateFileUpload()planUploadID
- an id obtained from initiateFileUpload(), may be nulloptions
- contains the list of deployment optionspublic void startDeploy(java.lang.Object deployID, java.util.Map source, java.util.Map plan, java.util.Map options)
Legal keys for use within the options Map include:
DEPLOY_OPTION_FORCE_KEY
DEPLOY_OPTION_CASCADE_KEY
DEPLOY_OPTION_VERIFY_KEY
DEPLOY_OPTION_ENABLE_KEY
DEPLOY_OPTION_CONTEXT_ROOT_KEY
DEPLOY_OPTION_NAME_KEY
DEPLOY_OPTION_DESCRIPTION_KEY
DEPLOY_OPTION_GENERATE_RMI_STUBS_KEY
DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
deployID
- an id obtained from initDeploy()source
- a DeploymentSource as a Mapplan
- will contain the deployment plan for this, may be null
deployment operation if the deployable archive is portableoptions
- contains the list of deployment options.public Notification[] takeNotifications(java.lang.Object deployID)
The deployment is done if the last Notification is of type
DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE
or
DEPLOYMENT_ABORTED_NOTIFICATION_TYPE
.
The deployment is not otherwise affected; you may still call
getFinalDeploymentStatus(java.lang.Object)
.
WARNING: This routine is for internal use only, and may not be supported in the future. External users should use the standard Notification mechanisms by registering as a listener
deployID
-
public boolean abortDeploy(java.lang.Object deployID)
deployID
- the id obtained from initDeploy()
public java.util.Map getFinalDeploymentStatus(java.lang.Object deployID)
WARNING: This routine is for internal use only, and may not be supported in the future. External users should use the standard Notification mechanisms by registering as a listener
deployID
- the id obtained from initDeploy()
public java.util.Map undeploy(java.lang.String moduleID, java.util.Map optionalParams)
moduleID
- the application module IDoptionalParams
- optional parameters
public java.lang.Object initiateFileDownload(java.lang.String moduleID, java.lang.String fileName) throws java.io.IOException
moduleID
- the deployed component moduleID this file download
is related to.fileName
- the desired file name corresponding to this module
java.io.IOException
public long getDownloadLength(java.lang.Object downloadID)
downloadID
- the file download operation id, from initiateFileDownload()public byte[] downloadBytes(java.lang.Object downloadID, int requestSize) throws java.io.IOException
downloadID
- the file download operation id, from initiateFileDownload()requestSize
-
java.io.IOException
|
J2EE1.4 SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003 Sun Microsystems, Inc. All rights reserved.