org.jboss.jmx.service
Class RemoteDeployer

java.lang.Object
  extended byorg.jboss.jmx.service.RemoteDeployer
All Implemented Interfaces:
org.jboss.deployment.Deployer, org.jboss.deployment.DeployerMBean

public class RemoteDeployer
extends Object
implements org.jboss.deployment.Deployer, org.jboss.deployment.DeployerMBean

A JMX client to deploy an application into a running JBoss server via RMI.

Version:
$Revision: 1.4.2.4 $
Author:
Rickard Öberg, Jason Dillon, Christoph G. Jung, Andreas Schaefer, Jason Dillon

Nested Class Summary
protected static class RemoteDeployer.DeployerCommand
          Switches equate to commands for the desired deploy/undeploy operation to execute; this is the base class for those commands.
 
Field Summary
protected  org.jboss.deployment.Deployer deployer
          A proxy to the deployer instance on the remote server.
static String PROGRAM_NAME
           
 
Constructor Summary
RemoteDeployer()
          Construct a new RemoteDeployer.
RemoteDeployer(javax.management.ObjectName deployerName, Hashtable env, String adapterName)
          Construct a new RemoteDeployer.
RemoteDeployer(javax.management.ObjectName deployerName, String url, String adapterName)
          Construct a new RemoteDeployer.
RemoteDeployer(String url, String adapterName)
          Construct a new RemoteDeployer.
 
Method Summary
 void deploy(String url)
          Deploys the given url on the remote server.
 void deploy(URL url)
          Deploys the given url on the remote server.
protected static void displayUsage()
           
protected  void init(javax.management.ObjectName deployerName, Hashtable env, String adapterName)
           
 boolean isDeployed(String url)
          Check if the given url is deployed on thr remote server.
 boolean isDeployed(URL url)
          Check if the given url is deployed on thr remote server.
protected  RemoteMBeanServer lookupRemoteMBeanServer(Hashtable env, String adapterName)
          Lookup the RemoteMBeanServer which will be used to invoke methods on.
static void main(String[] args)
           
 void undeploy(String url)
          Undeploys the application specifed by the given url on the remote server.
 void undeploy(URL url)
          Undeploys the application specifed by the given url on the remote server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deployer

protected org.jboss.deployment.Deployer deployer
A proxy to the deployer instance on the remote server.


PROGRAM_NAME

public static final String PROGRAM_NAME
Constructor Detail

RemoteDeployer

public RemoteDeployer(javax.management.ObjectName deployerName,
                      Hashtable env,
                      String adapterName)
               throws Exception
Construct a new RemoteDeployer.


RemoteDeployer

public RemoteDeployer(javax.management.ObjectName deployerName,
                      String url,
                      String adapterName)
               throws Exception
Construct a new RemoteDeployer.

Parameters:
url - The URL of the JNDI provider or null to use the default.

RemoteDeployer

public RemoteDeployer(String url,
                      String adapterName)
               throws Exception
Construct a new RemoteDeployer.

Uses MainDeployer and the given url for Context.PROVIDER_URL.


RemoteDeployer

public RemoteDeployer()
               throws Exception
Construct a new RemoteDeployer.

Uses MainDeployer.

Method Detail

init

protected void init(javax.management.ObjectName deployerName,
                    Hashtable env,
                    String adapterName)
             throws Exception
Throws:
Exception

lookupRemoteMBeanServer

protected RemoteMBeanServer lookupRemoteMBeanServer(Hashtable env,
                                                    String adapterName)
                                             throws Exception
Lookup the RemoteMBeanServer which will be used to invoke methods on.

Parameters:
env - The initial context environment or null to use default.
adapterName - The JNDI name of the RMI adapter or null for the default.
Throws:
Exception - Failed to lookup connector reference or retruned reference was not of type RMIAdapter.

deploy

public void deploy(URL url)
            throws org.jboss.deployment.DeploymentException
Deploys the given url on the remote server.

Specified by:
deploy in interface org.jboss.deployment.Deployer
Parameters:
url - The url of the application to deploy.
Throws:
org.jboss.deployment.DeploymentException - Failed to deploy application.

deploy

public void deploy(String url)
            throws MalformedURLException,
                   org.jboss.deployment.DeploymentException
Deploys the given url on the remote server.

Parameters:
url - The url of the application to deploy.
Throws:
org.jboss.deployment.DeploymentException - Failed to deploy application.
MalformedURLException - Invalid URL.

undeploy

public void undeploy(URL url)
              throws org.jboss.deployment.DeploymentException
Undeploys the application specifed by the given url on the remote server.

Specified by:
undeploy in interface org.jboss.deployment.Deployer
Parameters:
url - The url of the application to undeploy.
Throws:
org.jboss.deployment.DeploymentException - Failed to undeploy application.

undeploy

public void undeploy(String url)
              throws MalformedURLException,
                     org.jboss.deployment.DeploymentException
Undeploys the application specifed by the given url on the remote server.

Parameters:
url - The url of the application to undeploy.
Throws:
org.jboss.deployment.DeploymentException - Failed to undeploy application.
MalformedURLException - Invalid URL.

isDeployed

public boolean isDeployed(URL url)
Check if the given url is deployed on thr remote server.

Specified by:
isDeployed in interface org.jboss.deployment.Deployer
Parameters:
url - The url of the application to check.
Returns:
True if the application is deployed.

isDeployed

public boolean isDeployed(String url)
                   throws MalformedURLException
Check if the given url is deployed on thr remote server.

Parameters:
url - The url of the application to check.
Returns:
True if the application is deployed.
Throws:
org.jboss.deployment.DeploymentException - Failed to determine if application is deployed.
MalformedURLException - Invalid URL.

displayUsage

protected static void displayUsage()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.