|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DeploymentMgr
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
Util.getAMXNotificationValue(javax.management.Notification, java.lang.String)
Field Summary | |
---|---|
static String |
DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
Key for startDeploy) options-- This option controls whether availability is enabled for SFSB checkpointing (and potentially passivation). |
static 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 String |
DEPLOY_OPTION_CONTEXT_ROOT_KEY
Key for startDeploy) options-- The context root of the deployable web component. |
static String |
DEPLOY_OPTION_DESCRIPTION_KEY
Key for startDeploy) options-- The description of the component being deployed. |
static String |
DEPLOY_OPTION_ENABLE_KEY
Key for startDeploy) options-- Disables or enables the component after it is deployed. |
static String |
DEPLOY_OPTION_FORCE_KEY
Key for startDeploy() options-- Forcefully (re)deploy the component even if the specified component has already been deployed. |
static 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 String |
DEPLOY_OPTION_JAVA_WEB_START_ENABLED_KEY
Key for startDeploy) options-- This option controls whether java web start is enabled. |
static String |
DEPLOY_OPTION_LIBRARIES_KEY
Key for startDeploy) options-- This option specifies additional libraries. |
static String |
DEPLOY_OPTION_NAME_KEY
Key for startDeploy) options-- Registration name of the deployble component, its value should be unique across domain. |
static String |
DEPLOY_OPTION_VERIFY_KEY
Key for startDeploy() options-- If set to true, verify the syntax and semantics of the deployment descriptor. |
static String |
DEPLOYMENT_ABORTED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment is aborted via abortDeploy(). |
static String |
DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment completes. |
static String |
DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE
The type of the Notification emitted for deployment progress. |
static String |
DEPLOYMENT_STARTED_NOTIFICATION_TYPE
The type of the Notification emitted when a deployment starts. |
static String |
J2EE_TYPE
The j2eeType as returned by AMX.getJ2EEType() . |
static String |
KEY_PREFIX
Prefix for all keys used by DeploymentMgr |
static int |
MAX_DOWNLOAD_CHUNK_SIZE
The maximum allowed transfer size for downloading. |
static 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 String |
NOTIF_DEPLOYMENT_ID_KEY
Key within the Map of a Notification indicating deployment ID. |
static 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 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, JMX_DOMAIN, NAME_KEY, NO_NAME, NOTIFICATION_PREFIX, NULL_NAME |
Method Summary | ||
---|---|---|
boolean |
abortDeploy(Object deployID)
abort a given deployment operation, all modification to the server must be rollbacked and all resources cleaned. |
|
byte[] |
downloadBytes(Object downloadID,
int requestSize)
Download byte chunks from the server using a file operation id obtained via initiateFileDownload API. |
|
long |
getDownloadLength(Object downloadID)
Get the total length the download will be, in bytes. |
|
Map<String,Serializable> |
getFinalDeploymentStatus(Object deployID)
Return the final DeploymentStatus once the deployment has finished. |
|
Object |
initDeploy()
Create a new deploy ID which may be used via startDeploy() to start a new deployment operation. |
|
Object |
initiateFileDownload(String moduleID,
String fileName)
Initiates a file download with the given filename. |
|
Object |
initiateFileUpload(long totalSize)
initiatiate a new deployment operation, the id returned will be used to transfer the appropriate files on the server. |
|
Object |
initiateFileUpload(String name,
long totalSize)
This variant allows a name to be specified. |
|
|
startDeploy(Object deployID,
Map<String,T1> source,
Map<String,T2> plan,
Map<String,String> options)
Start a new deployment operation given a deployment source and a list of options. |
|
void |
startDeploy(Object deployID,
Object uploadID,
Object planUploadID,
Map<String,String> options)
Start the deployment operation using file(s) previously uploaded by initializeFileUpload() and uploadBytes(). |
|
Notification[] |
takeNotifications(Object deployID)
Deprecated. |
|
Map<String,Serializable> |
undeploy(String moduleID,
Map<String,String> 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(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, isDAS |
Methods inherited from interface javax.management.NotificationEmitter |
---|
removeNotificationListener |
Methods inherited from interface javax.management.NotificationBroadcaster |
---|
addNotificationListener, getNotificationInfo, removeNotificationListener |
Methods inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
---|
getMBeanLoggerName, getMBeanLogLevel, setMBeanLogLevel |
Field Detail |
---|
static final String J2EE_TYPE
AMX.getJ2EEType()
.
static final String KEY_PREFIX
static final String NOTIF_DEPLOYMENT_ID_KEY
Util.getAMXNotificationValue(javax.management.Notification, java.lang.String)
,
Constant Field Valuesstatic final String NOTIF_DEPLOYMENT_COMPLETED_STATUS_KEY
Util.getAMXNotificationValue(javax.management.Notification, java.lang.String)
,
Constant Field Valuesstatic final String NOTIF_DEPLOYMENT_PROGRESS_KEY
Util.getAMXNotificationValue(javax.management.Notification, java.lang.String)
,
Constant Field Valuesstatic final String DEPLOYMENT_STARTED_NOTIFICATION_TYPE
static final String DEPLOYMENT_COMPLETED_NOTIFICATION_TYPE
static final String DEPLOYMENT_ABORTED_NOTIFICATION_TYPE
static final String DEPLOYMENT_PROGRESS_NOTIFICATION_TYPE
static final String STUBS_JARFILENAME
static final String DEPLOY_OPTION_FORCE_KEY
static final 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.
static final String DEPLOY_OPTION_VERIFY_KEY
static final String DEPLOY_OPTION_ENABLE_KEY
static final String DEPLOY_OPTION_CONTEXT_ROOT_KEY
static final String DEPLOY_OPTION_NAME_KEY
static final String DEPLOY_OPTION_DESCRIPTION_KEY
static final String DEPLOY_OPTION_GENERATE_RMI_STUBS_KEY
static final String DEPLOY_OPTION_AVAILABILITY_ENABLED_KEY
static final String DEPLOY_OPTION_JAVA_WEB_START_ENABLED_KEY
static final String DEPLOY_OPTION_LIBRARIES_KEY
Libraries
,
Constant Field Valuesstatic final int MAX_DOWNLOAD_CHUNK_SIZE
Method Detail |
---|
Object initiateFileUpload(long totalSize) throws IOException
totalSize
- total size of the file to upload
IOException
Object initiateFileUpload(String name, long totalSize) throws IOException
name
- name to be used for the temp filetotalSize
- total size of the file to upload
IOException
boolean uploadBytes(Object uploadID, byte[] bytes) throws IOException
uploadID
- the id obtained from initiateFileUpload()bytes
- the bytes to upload
IOException
Object initDeploy()
void startDeploy(Object deployID, Object uploadID, Object planUploadID, Map<String,String> 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
DEPLOY_OPTION_JAVA_WEB_START_ENABLED_KEY
DEPLOY_OPTION_LIBRARIES_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 options<T1 extends Serializable,T2 extends Serializable> void startDeploy(Object deployID, Map<String,T1> source, Map<String,T2> plan, Map<String,String> 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.Notification[] takeNotifications(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
-
boolean abortDeploy(Object deployID)
deployID
- the id obtained from initDeploy()
Map<String,Serializable> getFinalDeploymentStatus(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()
Map<String,Serializable> undeploy(String moduleID, Map<String,String> optionalParams)
moduleID
- the application module IDoptionalParams
- optional parameters
Object initiateFileDownload(String moduleID, String fileName) throws IOException
moduleID
- the deployed component moduleID this file download
is related to.fileName
- the desired file name corresponding to this module
IOException
long getDownloadLength(Object downloadID)
downloadID
- the file download operation id, from initiateFileDownload()byte[] downloadBytes(Object downloadID, int requestSize) throws IOException
downloadID
- the file download operation id, from initiateFileDownload()requestSize
-
IOException
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.