|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Contract public interface ServicePlugin<T extends ServiceType>
An SPI to allow the adding of multiple service provider implementations
into the PaaS runtime. Each Plugin supports a Service of a
particular ServiceType
ServiceDescription
and ProvisionedService.
A Plugin for a Service implementation performs the following functions:
| Method Summary | |
|---|---|
void |
associateServices(Service serviceConsumer,
ServiceReference svcRef,
Service serviceProvider,
boolean beforeDeployment,
PaaSDeploymentContext dc)
A ProvisionedService for a ServiceReference is
associated with another ProvisionedService through this method. |
boolean |
deploy(PaaSDeploymentContext dc,
Service service)
Deploy the orchestration-enabled archive. |
void |
dissociateServices(Service serviceConsumer,
ServiceReference svcRef,
Service serviceProvider,
boolean beforeUndeploy,
PaaSDeploymentContext dc)
A ProvisionedService for a ServiceReference is
dis-associated from another ProvisionedService through this method. |
ServiceDescription |
getDefaultServiceDescription(String appName,
ServiceReference svcRef)
For a discovered (implicit) ServiceReference, the application developer may not have provided corresponding ServiceDefinitions to satisfy the ServiceReference. |
Set<ServiceDescription> |
getImplicitServiceDescriptions(ReadableArchive cloudArchive,
String appName,
PaaSDeploymentContext context)
OE gets implicit ServiceDescription associated with an
application from the Plugin through this method,
if the application does not have explicit ServiceDescription |
ProvisionedService |
getProvisionedService(ServiceDescription serviceDescription,
ServiceInfo serviceInfo)
When CPAS is restarted, the CPAS uses this method to get the ProvisionedService that were provisioned earlier
through the plugin. |
Set<ServiceReference> |
getServiceReferences(String appName,
ReadableArchive cloudArchive,
PaaSDeploymentContext dc)
Discover the implicit service references in the orchestration enabled archive. |
T |
getServiceType()
Provides the ServiceType supported by this plugin |
boolean |
handles(ReadableArchive cloudArchive)
Checks if this plugin can process and handle the provided orchestration enabled archive |
boolean |
handles(ServiceDescription serviceDescription)
Checks if this plugin can handle the specified service-description |
boolean |
isReferenceTypeSupported(String referenceType)
Checks if a service reference of a particular ref-type can be supported by a service that this plugin can provision. |
boolean |
isRunning(ProvisionedService provisionedSvc)
Checks if a ProvisionedService is still running (ie ping service). |
ProvisionedService |
match(ServiceReference svcRef)
Given a ServiceReference, find if a Service has already been
provisioned for it. |
ProvisionedService |
provisionService(ServiceDescription serviceDescription,
PaaSDeploymentContext paasDC)
Once the CPAS merges all discovered and explicit ServiceDefinitionss, it provisions the required Services
through the Plugin. |
boolean |
reassociateServices(Service svcConsumer,
Service oldSvcProvider,
Service newSvcProvider,
ServiceOrchestrator.ReconfigAction reason)
When a Service has been re-provisioned, and a prior deployment has already been bound to the earlier ProvisionedService, CPAS uses this method to reassociate resources of the "Service Consumer" ProvisionedService to point to the new "Service Provider"
ProvisionedService. |
boolean |
reconfigureServices(ProvisionedService oldPS,
ProvisionedService newPS)
When a Service has been re-provisioned, and a prior deployment has already been bound to the earlier ProvisionedService, CAS uses this method to reassociate resources to point to the newly ProvisionedService |
ProvisionedService |
scaleService(ProvisionedService provisionedService,
int scaleCount,
AllocationStrategy allocStrategy)
Scales the size of a Service up or down as per the provided scalingFactor. |
ProvisionedService |
startService(ServiceDescription serviceDescription,
ServiceInfo serviceInfo)
Start a Service that had been provisioned earlier and is now Stopped. |
boolean |
stopService(ProvisionedService provisionedService,
ServiceInfo serviceInfo)
Stop a ProvisionedService. |
boolean |
undeploy(PaaSDeploymentContext dc,
Service service)
Undeploy the orchestration-enabled archive. |
boolean |
unprovisionService(ServiceDescription serviceDescription,
PaaSDeploymentContext dc)
During undeployment of an application, OE decommissions the Services that are scoped to the application. |
| Method Detail |
|---|
T getServiceType()
ServiceType supported by this plugin
ServiceType supported by this pluginboolean handles(ReadableArchive cloudArchive)
boolean handles(ServiceDescription serviceDescription)
serviceDescription - service-description to be handled
boolean isReferenceTypeSupported(String referenceType)
Set<ServiceReference> getServiceReferences(String appName,
ReadableArchive cloudArchive,
PaaSDeploymentContext dc)
appName - application-name as generated by deployment framework.cloudArchive - the orchestration-enabled archive for which the CAS needs to determine
implicit ServiceReferencesdc - PaaS deployment context
ServiceDescription getDefaultServiceDescription(String appName,
ServiceReference svcRef)
Set<ServiceDescription> getImplicitServiceDescriptions(ReadableArchive cloudArchive,
String appName,
PaaSDeploymentContext context)
ServiceDescription associated with an
application from the Plugin through this method,
if the application does not have explicit ServiceDescriptions
in its services metadata deployment descriptor, for the type supported
by the Plugin.
- Parameters:
cloudArchive - The application archiveappName - The application Name
- Returns:
- A
Set of implicit ServiceDescriptions
that this Plugin "implies" for the provided application archive.
ProvisionedService provisionService(ServiceDescription serviceDescription,
PaaSDeploymentContext paasDC)
ServiceDefinitionss, it provisions the required Services
through the Plugin.
The Plugin is responsible for ensuring that the provisioning
action is atomic. That is, the Service that is being provisioned must be
completely provisioned or not at all.
serviceDescription - ServiceDescription that will be used to provision a service.paasDC - PaaSDeploymentContext that provides application deployment context
ProvisionedServices
ProvisionedService getProvisionedService(ServiceDescription serviceDescription,
ServiceInfo serviceInfo)
ProvisionedService that were provisioned earlier
through the plugin.
serviceDescription - ServiceDescription for the
service dependency.serviceInfo - The ServiceInfo persisted in the
configuration store for the ProvisionedService
ProvisionedService instance that represents
details about the provisioned service.
boolean unprovisionService(ServiceDescription serviceDescription,
PaaSDeploymentContext dc)
serviceDescription - The ServiceDescription associated
with the provisioned service that needs to be decommissioned.dc - The DeploymentContext associated with the
undeployment operation that initiated this decomissioning process.
ProvisionedService scaleService(ProvisionedService provisionedService,
int scaleCount,
AllocationStrategy allocStrategy)
provisionedService - Existing ProvisionedServicescaleCount - Number of units of the Service that needs to be scaled.
A positive number for scaling up and a negative number for scaling down.allocStrategy - The allocationStrategy that needs to be utilized
to scale the Service. The allocationStrategy implementation that is
provided could be used to spawn a new instance in a less-loaded/underutilized
machine in the ServerPool. This could be null, if the default
allocation strategy needs to be employed.
void associateServices(Service serviceConsumer,
ServiceReference svcRef,
Service serviceProvider,
boolean beforeDeployment,
PaaSDeploymentContext dc)
ProvisionedService for a ServiceReference is
associated with another ProvisionedService through this method.
See the section on "Service Association/Binding" at
http://wikis.sun.com/display/GlassFish/3.2+Service+Orchestration+One+Pager
for more information.
serviceConsumer - The "target" ProvisionedServicesvcRef - The ServiceReference that binds the "source"
and "target" ServiceReferences.serviceProvider - The "source" ProvisionedServicebeforeDeployment - Indicates if this association is happening before
the deployment of the applicationdc - The DeploymentContext associated with the application
deployment or enablement that caused this association
void dissociateServices(Service serviceConsumer,
ServiceReference svcRef,
Service serviceProvider,
boolean beforeUndeploy,
PaaSDeploymentContext dc)
ProvisionedService for a ServiceReference is
dis-associated from another ProvisionedService through this method.
See the section on "Service Association/Binding" at
http://wikis.sun.com/display/GlassFish/3.2+Service+Orchestration+One+Pager
for more information.
serviceConsumer - The "target" ProvisionedServicesvcRef - The ServiceReference that bound the "source"
and "target" ServiceReferences.serviceProvider - The "source" ProvisionedServicebeforeUndeploy - Indicates if this dis-association is happening before
the deployment of the applicationdc - The DeploymentContext associated with the application
undeployment or disablement that caused this dis-association
boolean deploy(PaaSDeploymentContext dc,
Service service)
dc - PaaSDeploymentContextservice - Service to which deployment needs to be done.
boolean undeploy(PaaSDeploymentContext dc,
Service service)
dc - PaaSDeploymentContextservice - Service to which deployment needs to be done.
ProvisionedService startService(ServiceDescription serviceDescription,
ServiceInfo serviceInfo)
serviceDescription - The ServiceDescription of the
Service that needs to be startedserviceInfo - The ServiceInfo that captures the prior
provisioning state of the Service
boolean stopService(ProvisionedService provisionedService,
ServiceInfo serviceInfo)
ProvisionedService.
provisionedService - The ProvisionedService of the
Service that needs to be stoppedserviceInfo - The ServiceInfo that captures the
provisioned state of the Service
boolean isRunning(ProvisionedService provisionedSvc)
ProvisionedService match(ServiceReference svcRef)
ServiceReference, find if a Service has already been
provisioned for it.
boolean reconfigureServices(ProvisionedService oldPS,
ProvisionedService newPS)
ProvisionedService
boolean reassociateServices(Service svcConsumer,
Service oldSvcProvider,
Service newSvcProvider,
ServiceOrchestrator.ReconfigAction reason)
ProvisionedService to point to the new "Service Provider"
ProvisionedService.
Some of the reasons reconfiguration may occur are auto-scaling
of Services, CPAS or VM restarts.
svcConsumer - The Service Consumer ProvisionedServiceoldSvcProvider - The old Service Provider ProvisionedServicenewSvcProvider - The new Service Provider ProvisionedServicereason - The reason for the re-configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||