Class ConnectorApplication
- java.lang.Object
-
- com.sun.enterprise.connectors.module.ConnectorApplication
-
- All Implemented Interfaces:
ApplicationContainer
,EventListener
public class ConnectorApplication extends Object implements ApplicationContainer, EventListener
Represents a connector application, one per resource-adapter. GlassFish kernel will call start/stop of connector application during start/stop of server and deploy/undeploy of the resource-adapter.- Author:
- Jagadish Ramu
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Constructor Summary
Constructors Constructor Description ConnectorApplication(String moduleName, String appName, ResourceManager resourceManager, ApplicationScopedResourcesManager asrManager, ClassLoader loader, ConnectorRuntime runtime, Events event, ConnectorDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deployResources()
deploy all resources/pools pertaining to this resource adaptervoid
event(EventListener.Event event)
event listener to listen to resource-adapter undeploy validation and to validate the undeployment.String
getApplicationName()
ClassLoader
getClassLoader()
Returns the class loader associated with this applicationObject
getDescriptor()
Returns the deployment descriptor associated with this applicationString
getModuleName()
returns the module namevoid
logFine(String message)
boolean
resume()
Resumes this application container.void
setModuleName(String moduleName)
set the module name of the applicationboolean
start(ApplicationContext startupContext)
Starts an application container.boolean
stop(ApplicationContext stopContext)
Stop the application containerboolean
suspend()
Suspends this application container.boolean
undeployGlobalResources(boolean failIfResourcesExist)
undeploy all resources/pools pertaining to this resource adaptervoid
undeployResources()
undeploy all resources/pools pertaining to this resource adapter-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.api.deployment.ApplicationContainer
initialize, reload
-
-
-
-
Constructor Detail
-
ConnectorApplication
public ConnectorApplication(String moduleName, String appName, ResourceManager resourceManager, ApplicationScopedResourcesManager asrManager, ClassLoader loader, ConnectorRuntime runtime, Events event, ConnectorDescriptor descriptor)
-
-
Method Detail
-
getDescriptor
public Object getDescriptor()
Returns the deployment descriptor associated with this application- Specified by:
getDescriptor
in interfaceApplicationContainer
- Returns:
- deployment descriptor if they exist or null if not
-
start
public boolean start(ApplicationContext startupContext)
Starts an application container. ContractProvider starting should not throw an exception but rather should use their prefered Logger instance to log any issue they encounter while starting. Returning false from a start mean that the container failed to start- Specified by:
start
in interfaceApplicationContainer
- Parameters:
startupContext
- the start up context- Returns:
- true if the container startup was successful.
-
deployResources
public void deployResources()
deploy all resources/pools pertaining to this resource adapter
-
undeployResources
public void undeployResources()
undeploy all resources/pools pertaining to this resource adapter
-
undeployGlobalResources
public boolean undeployGlobalResources(boolean failIfResourcesExist)
undeploy all resources/pools pertaining to this resource adapter
-
stop
public boolean stop(ApplicationContext stopContext)
Stop the application container- Specified by:
stop
in interfaceApplicationContainer
- Parameters:
stopContext
-- Returns:
- true if stopping was successful.
-
suspend
public boolean suspend()
Suspends this application container.- Specified by:
suspend
in interfaceApplicationContainer
- Returns:
- true if suspending was successful, false otherwise.
-
resume
public boolean resume()
Resumes this application container.- Specified by:
resume
in interfaceApplicationContainer
- Returns:
- true if resumption was successful, false otherwise.
-
getClassLoader
public ClassLoader getClassLoader()
Returns the class loader associated with this application- Specified by:
getClassLoader
in interfaceApplicationContainer
- Returns:
- ClassLoader for this app
-
logFine
public void logFine(String message)
-
getModuleName
public String getModuleName()
returns the module name- Returns:
- module-name
-
setModuleName
public void setModuleName(String moduleName)
set the module name of the application- Parameters:
moduleName
- module-name
-
getApplicationName
public String getApplicationName()
-
event
public void event(EventListener.Event event)
event listener to listen to resource-adapter undeploy validation and to validate the undeployment. Undeployment will fail, if resources are found and --cascade is not set.- Specified by:
event
in interfaceEventListener
- Parameters:
event
- Event
-
-