public final class Deployment extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Deployment.DeploymentException |
static interface |
Deployment.Logger |
static class |
Deployment.Mode
Deployment mode enumeration
|
Modifier and Type | Method and Description |
---|---|
void |
addInstanceListener(InstanceListener l)
Register an instance listener that will listen to server instances changes.
|
boolean |
canFileDeploy(String instanceId,
J2eeModule mod)
Determine if a server instance will attempt to use file deployment for a
J2eeModule.
|
String |
deploy(J2eeModuleProvider jmp,
boolean debug,
String clientModuleUrl,
String clientUrlPart,
boolean forceRedeploy)
|
String |
deploy(J2eeModuleProvider jmp,
boolean debug,
String clientModuleUrl,
String clientUrlPart,
boolean forceRedeploy,
Deployment.Logger logger)
Deprecated.
|
String |
deploy(J2eeModuleProvider jmp,
Deployment.Mode mode,
String clientModuleUrl,
String clientUrlPart,
boolean forceRedeploy)
Deploys a web J2EE module to server.
|
String |
deploy(J2eeModuleProvider jmp,
Deployment.Mode mode,
String clientModuleUrl,
String clientUrlPart,
boolean forceRedeploy,
Deployment.Logger logger) |
String |
deploy(J2eeModuleProvider jmp,
Deployment.Mode mode,
String clientModuleUrl,
String clientUrlPart,
boolean forceRedeploy,
Deployment.Logger logger,
Callable<Void> beforeDeploy)
Deploys the module represented by the module provider.
|
void |
disableCompileOnSaveSupport(J2eeModuleProvider provider) |
void |
enableCompileOnSaveSupport(J2eeModuleProvider provider) |
static Deployment |
getDefault() |
String |
getDefaultServerInstanceID()
Deprecated.
this API is broken by design - the client should choose the
instance by usage
Deployment.getServerInstanceIDs() and selection
of appropriate server instance. Method will be removed in
near future. See issue 83934. |
String[] |
getInstancesOfServer(String id) |
J2eePlatform |
getJ2eePlatform(String serverInstanceID)
Deprecated.
use
getServerInstance(serverInstanceID).getJ2eePlatform() |
String |
getServerDisplayName(String id)
Returns the display name of the server with given id.
|
String |
getServerID(String instanceId)
Deprecated.
use
getServerInstance(serverInstanceID).getServerID() |
String[] |
getServerIDs() |
ServerInstance |
getServerInstance(String serverInstanceId)
Returns the server instance allowing client to query its properties
and/or status.
|
String |
getServerInstanceDisplayName(String id)
Deprecated.
use
getServerInstance(serverInstanceID).getDisplayName() |
String[] |
getServerInstanceIDs() |
String[] |
getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes)
Return ServerInstanceIDs of all registered server instances that support
specified module types.
|
String[] |
getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes,
org.netbeans.api.j2ee.core.Profile profile)
Return ServerInstanceIDs of all registered server instances that support
specified module types and profile.
|
String[] |
getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes,
org.netbeans.api.j2ee.core.Profile profile,
String[] tools)
Return ServerInstanceIDs of all registered server instances that support
specified module types, profile and tools.
|
String[] |
getServerInstanceIDs(Object[] moduleTypes)
|
String[] |
getServerInstanceIDs(Object[] moduleTypes,
String specVersion)
Deprecated.
use
#getServerInstanceIDs(java.util.Collection, org.netbeans.modules.j2ee.deployment.devmodules.api.Profile) |
String[] |
getServerInstanceIDs(Object[] moduleTypes,
String specVersion,
String[] tools)
Deprecated.
use
#getServerInstanceIDs(java.util.Collection, org.netbeans.modules.j2ee.deployment.capabilities.Profile, java.lang.String[]) |
boolean |
isRunning(String serverInstanceID)
Deprecated.
use
getServerInstance(serverInstanceID).isRunning() |
void |
removeInstanceListener(InstanceListener l)
Remove an instance listener which has been registered previously.
|
void |
resumeDeployOnSave(J2eeModuleProvider jmp)
Resumes the deploy on save execution.
|
void |
suspendDeployOnSave(J2eeModuleProvider jmp)
Suspends the deploy on save execution regardless of user selection.
|
void |
undeploy(J2eeModuleProvider jmp,
boolean startServer,
Deployment.Logger logger)
Undeploys the project (if it is deployed and available).
|
public static Deployment getDefault()
@Deprecated public String deploy(J2eeModuleProvider jmp, boolean debug, String clientModuleUrl, String clientUrlPart, boolean forceRedeploy) throws Deployment.DeploymentException
Deployment.deploy(org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider, org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.Mode, java.lang.String, java.lang.String, boolean)
insteadclientModuleUrl
- URL of module within a J2EE Application that
should be used as a client (can be null for standalone modules)
Note: if null for J2EE application the first web or client module will be used.
Deployment.DeploymentException
public String deploy(J2eeModuleProvider jmp, Deployment.Mode mode, String clientModuleUrl, String clientUrlPart, boolean forceRedeploy) throws Deployment.DeploymentException
clientModuleUrl
- URL of module within a J2EE Application that
should be used as a client (can be null for standalone modules)
Note: if null for J2EE application the first web or client module will be used.
Deployment.DeploymentException
@Deprecated public String deploy(J2eeModuleProvider jmp, boolean debug, String clientModuleUrl, String clientUrlPart, boolean forceRedeploy, Deployment.Logger logger) throws Deployment.DeploymentException
Deployment.deploy(org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider, org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.Mode, java.lang.String, java.lang.String, boolean, org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.Logger)
insteadDeployment.DeploymentException
public void suspendDeployOnSave(J2eeModuleProvider jmp)
jmp
- java ee project representationpublic void resumeDeployOnSave(J2eeModuleProvider jmp)
Deployment.suspendDeployOnSave(org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider)
it is noop.jmp
- java ee project representationpublic String deploy(J2eeModuleProvider jmp, Deployment.Mode mode, String clientModuleUrl, String clientUrlPart, boolean forceRedeploy, Deployment.Logger logger) throws Deployment.DeploymentException
Deployment.DeploymentException
@CheckForNull public String deploy(J2eeModuleProvider jmp, Deployment.Mode mode, String clientModuleUrl, String clientUrlPart, boolean forceRedeploy, Deployment.Logger logger, @NullAllowed Callable<Void> beforeDeploy) throws Deployment.DeploymentException
jmp
- the representation of module to deploymode
- the mode we are going to use for the serverclientModuleUrl
- clientUrlPart
- forceRedeploy
- whether to use the force to redeploylogger
- logger where to log progress messagesbeforeDeploy
- the hook to be executed just before the actual module deployDeployment.DeploymentException
- if the deployment failspublic void undeploy(J2eeModuleProvider jmp, boolean startServer, Deployment.Logger logger) throws Deployment.DeploymentException
jmp
- provider representing the projectstartServer
- if true
server may be started while
trying to determine whether the project is deployedlogger
- logger for undeploy related eventsDeployment.DeploymentException
public void enableCompileOnSaveSupport(J2eeModuleProvider provider)
public void disableCompileOnSaveSupport(J2eeModuleProvider provider)
public String[] getServerInstanceIDs()
@Deprecated public String[] getServerInstanceIDs(Object[] moduleTypes)
moduleTypes
- list of module types that the server instance must support.public String[] getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes)
moduleTypes
- collection of module types that the server instance must support@Deprecated public String[] getServerInstanceIDs(Object[] moduleTypes, String specVersion)
#getServerInstanceIDs(java.util.Collection, org.netbeans.modules.j2ee.deployment.devmodules.api.Profile)
moduleTypes
- list of module types that the server instance must support.specVersion
- J2EE specification version that the server instance must support.public String[] getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes, org.netbeans.api.j2ee.core.Profile profile)
moduleTypes
- list of module types that the server instance must supportprofile
- profile that the server instance must support@Deprecated public String[] getServerInstanceIDs(Object[] moduleTypes, String specVersion, String[] tools)
#getServerInstanceIDs(java.util.Collection, org.netbeans.modules.j2ee.deployment.capabilities.Profile, java.lang.String[])
moduleTypes
- list of module types that the server instance must support.specVersion
- J2EE specification version that the server instance must support.tools
- list of tools that the server instance must support.public String[] getServerInstanceIDs(Collection<J2eeModule.Type> moduleTypes, org.netbeans.api.j2ee.core.Profile profile, String[] tools)
moduleTypes
- list of module types that the server instance must supportprofile
- profile that the server instance must supporttools
- list of tools that the server instance must support@Deprecated public String getServerInstanceDisplayName(String id)
getServerInstance(serverInstanceID).getDisplayName()
id
- id of the instancenull
if the
instance does not exist or not defined@Deprecated public String getServerID(String instanceId)
getServerInstance(serverInstanceID).getServerID()
instanceId
- id of the instancenull
if the
instance does not exist@Deprecated public String getDefaultServerInstanceID()
Deployment.getServerInstanceIDs()
and selection
of appropriate server instance. Method will be removed in
near future. See issue 83934.null
if no default
instance configured.
This method is deprecated, so don't expect it will return any useful default instance. Method will be removed in near future.
public boolean canFileDeploy(String instanceId, J2eeModule mod)
instanceId
- The target instance's server idmod
- The module to be deployedpublic ServerInstance getServerInstance(String serverInstanceId)
serverInstanceId
- id of the server instancepublic String[] getServerIDs()
@Deprecated public J2eePlatform getJ2eePlatform(String serverInstanceID)
getServerInstance(serverInstanceID).getJ2eePlatform()
J2eePlatform
.serverInstanceID
- server instance ID.J2eePlatform
for the given server instance, null
if
server instance of the specified ID does not exist.public String getServerDisplayName(String id)
Client is usually searching for the display name of the server for particular
instance. For this use getServerInstance(serverInstanceID).getServerDisplyName()
.
id
- id of the servernull
if the server does not exist@Deprecated public boolean isRunning(String serverInstanceID)
getServerInstance(serverInstanceID).isRunning()
true
if the given server instance exists and is running,
false
otherwise.
Never call this method from the event dispatch thread since it might take several seconds before it finishes.
serverInstanceID
- server instance ID.true
if the given server instance is running, false
otherwise.NullPointerException
- if serverInstanceID is null
.public final void addInstanceListener(InstanceListener l)
l
- listener which should be added.public final void removeInstanceListener(InstanceListener l)
l
- listener which should be removed.