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 voiddeployResources()deploy all resources/pools pertaining to this resource adaptervoidevent(EventListener.Event event)event listener to listen to resource-adapter undeploy validation and to validate the undeployment.StringgetApplicationName()ClassLoadergetClassLoader()Returns the class loader associated with this applicationObjectgetDescriptor()Returns the deployment descriptor associated with this applicationStringgetModuleName()returns the module namevoidlogFine(String message)booleanresume()Resumes this application container.voidsetModuleName(String moduleName)set the module name of the applicationbooleanstart(ApplicationContext startupContext)Starts an application container.booleanstop(ApplicationContext stopContext)Stop the application containerbooleansuspend()Suspends this application container.booleanundeployGlobalResources(boolean failIfResourcesExist)undeploy all resources/pools pertaining to this resource adaptervoidundeployResources()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:
getDescriptorin 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:
startin 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:
stopin interfaceApplicationContainer- Parameters:
stopContext-- Returns:
- true if stopping was successful.
-
suspend
public boolean suspend()
Suspends this application container.- Specified by:
suspendin interfaceApplicationContainer- Returns:
- true if suspending was successful, false otherwise.
-
resume
public boolean resume()
Resumes this application container.- Specified by:
resumein interfaceApplicationContainer- Returns:
- true if resumption was successful, false otherwise.
-
getClassLoader
public ClassLoader getClassLoader()
Returns the class loader associated with this application- Specified by:
getClassLoaderin 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:
eventin interfaceEventListener- Parameters:
event- Event
-
-