org.kuali.rice.ksb.api.bus.support
Class AbstractServiceDefinition

java.lang.Object
  extended by org.kuali.rice.ksb.api.bus.support.AbstractServiceDefinition
All Implemented Interfaces:
ServiceDefinition
Direct Known Subclasses:
JavaServiceDefinition, RestServiceDefinition, SoapServiceDefinition

public abstract class AbstractServiceDefinition
extends Object
implements ServiceDefinition

The definition of a service on the service bus.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
protected AbstractServiceDefinition()
           
 
Method Summary
protected abstract  ServiceConfiguration configure()
           
 boolean equals(Object object)
           
 Endpoint establishEndpoint()
          Establishes and returns an Endpoint to this service which generates the ServiceConfiguration for this service definition as well as including the actual service implementation as provided by ServiceDefinition.getService().
 String getApplicationId()
          Returns the id of the application which owns this service.
 Boolean getBusSecurity()
          Returns true if this service is secured by standard KSB security features.
 String getCacheManager()
          Returns the name of the cache manager to use.
 CredentialsType getCredentialsType()
          Returns the type of security credentials that should be used when attempting to authorize access to this service.
 URL getEndpointUrl()
          Returns the URL of the endpoint which provides this service.
 String getInstanceId()
          Returns the id of the specific instance of the application which owns this service
 String getLocalServiceName()
           
 String getMessageExceptionHandler()
          Returns the name of the exception handler to invoke whenever messages to this service fail to be sent.
 Long getMillisToLive()
          Returns the maximum amount of milliseconds a message to this service can live and attempt to be processed successfully by this service before it's forced into processing by it's exception handler.
 Integer getPriority()
          Returns the processing priority for messages that are sent to this service.
 Integer getRetryAttempts()
          Returns the retry attempts to use when processing messages sent to this service.
 Object getService()
          Return the actual service implementation to publish and export to the service bus.
 ClassLoader getServiceClassLoader()
          Returns the ClassLoader that should be set as the context classloader on the thread prior to any invocations on the service
 QName getServiceName()
          Returns the qualified name for this service.
 String getServiceNameSpaceURI()
           
 String getServicePath()
          Returns the url path to export the service under.
 String getServiceVersion()
          Returns the version of this service.
 int hashCode()
           
 boolean isQueue()
          Return true if this service uses queue-style messaging, false if it uses topic-style messaging.
 void setApplicationId(String applicationId)
           
 void setBusSecurity(Boolean busSecurity)
           
 void setCacheManager(String cacheManager)
           
 void setCredentialsType(CredentialsType credentialsType)
           
 void setEndpointUrl(URL endpointUrl)
           
 void setInstanceId(String instanceId)
           
 void setLocalServiceName(String serviceName)
           
 void setMessageExceptionHandler(String messageExceptionHandler)
           
 void setMillisToLive(Long millisToLive)
           
 void setPriority(Integer priority)
           
 void setQueue(boolean queue)
           
 void setRetryAttempts(Integer retryAttempts)
           
 void setService(Object service)
           
 void setServiceClassLoader(ClassLoader serviceClassLoader)
           
 void setServiceName(QName serviceName)
           
 void setServiceNameSpaceURI(String serviceNameSpaceURI)
           
 void setServicePath(String servicePath)
           
 void setServiceVersion(String serviceVersion)
           
 String toString()
           
 void validate()
          Validates the service definition after creation of the service definition.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.ksb.api.bus.ServiceDefinition
getType
 

Constructor Detail

AbstractServiceDefinition

protected AbstractServiceDefinition()
Method Detail

getService

public Object getService()
Description copied from interface: ServiceDefinition
Return the actual service implementation to publish and export to the service bus.

Specified by:
getService in interface ServiceDefinition
Returns:
the service to publish

setService

public void setService(Object service)

getLocalServiceName

public String getLocalServiceName()

setLocalServiceName

public void setLocalServiceName(String serviceName)

getMessageExceptionHandler

public String getMessageExceptionHandler()
Description copied from interface: ServiceDefinition
Returns the name of the exception handler to invoke whenever messages to this service fail to be sent. If null, the default message exception handler will be used.

Specified by:
getMessageExceptionHandler in interface ServiceDefinition
Returns:
the name of the message exception handler for this service, or null if the default handler should be used

setMessageExceptionHandler

public void setMessageExceptionHandler(String messageExceptionHandler)

getPriority

public Integer getPriority()
Description copied from interface: ServiceDefinition
Returns the processing priority for messages that are sent to this service.

Specified by:
getPriority in interface ServiceDefinition
Returns:
the message processing priority for this service

setPriority

public void setPriority(Integer priority)

isQueue

public boolean isQueue()
Description copied from interface: ServiceDefinition
Return true if this service uses queue-style messaging, false if it uses topic-style messaging.

Specified by:
isQueue in interface ServiceDefinition
Returns:
true if this service uses queue-style messaging, false if it uses topic-style messaging

setQueue

public void setQueue(boolean queue)

getRetryAttempts

public Integer getRetryAttempts()
Description copied from interface: ServiceDefinition
Returns the retry attempts to use when processing messages sent to this service.

Specified by:
getRetryAttempts in interface ServiceDefinition
Returns:
the retry attempts for this service

setRetryAttempts

public void setRetryAttempts(Integer retryAttempts)

getServiceName

public QName getServiceName()
Description copied from interface: ServiceDefinition
Returns the qualified name for this service.

Specified by:
getServiceName in interface ServiceDefinition
Returns:
the qualified name for this service

setServiceName

public void setServiceName(QName serviceName)

getEndpointUrl

public URL getEndpointUrl()
Description copied from interface: ServiceDefinition
Returns the URL of the endpoint which provides this service.

Specified by:
getEndpointUrl in interface ServiceDefinition
Returns:
the endpoint URL of the service

setEndpointUrl

public void setEndpointUrl(URL endpointUrl)

setCredentialsType

public void setCredentialsType(CredentialsType credentialsType)

getCredentialsType

public CredentialsType getCredentialsType()
Description copied from interface: ServiceDefinition
Returns the type of security credentials that should be used when attempting to authorize access to this service.

Specified by:
getCredentialsType in interface ServiceDefinition
Returns:
the type of security credentials to use when access this service

getServiceVersion

public String getServiceVersion()
Description copied from interface: ServiceDefinition
Returns the version of this service.

Specified by:
getServiceVersion in interface ServiceDefinition
Returns:
the version of this service

setServiceVersion

public void setServiceVersion(String serviceVersion)

getApplicationId

public String getApplicationId()
Description copied from interface: ServiceDefinition
Returns the id of the application which owns this service.

Specified by:
getApplicationId in interface ServiceDefinition
Returns:
the id of the application which owns this service

setApplicationId

public void setApplicationId(String applicationId)

getInstanceId

public String getInstanceId()
Description copied from interface: ServiceDefinition
Returns the id of the specific instance of the application which owns this service

Specified by:
getInstanceId in interface ServiceDefinition
Returns:
the id of the specific instance of the application which owns this service

setInstanceId

public void setInstanceId(String instanceId)

getServiceClassLoader

public ClassLoader getServiceClassLoader()
Description copied from interface: ServiceDefinition
Returns the ClassLoader that should be set as the context classloader on the thread prior to any invocations on the service

Specified by:
getServiceClassLoader in interface ServiceDefinition
Returns:
the classloader for this service

setServiceClassLoader

public void setServiceClassLoader(ClassLoader serviceClassLoader)

getCacheManager

public String getCacheManager()
Description copied from interface: ServiceDefinition
Returns the name of the cache manager to use. If null or blank then caching is effectively disabled for this service.

Specified by:
getCacheManager in interface ServiceDefinition
Returns:
the cache manager name or null

setCacheManager

public void setCacheManager(String cacheManager)

validate

public void validate()
Description copied from interface: ServiceDefinition
Validates the service definition after creation of the service definition. It's intended that portions of the KSB that handle publication and export of services to the bus will execute this prior to successful export of the service.

Specified by:
validate in interface ServiceDefinition

establishEndpoint

public Endpoint establishEndpoint()
Description copied from interface: ServiceDefinition
Establishes and returns an Endpoint to this service which generates the ServiceConfiguration for this service definition as well as including the actual service implementation as provided by ServiceDefinition.getService().

The ServiceDefinition.validate() method should be invoked prior to executing this method in order to ensure that the appropriate internal state for the ServiceDefinition has been established.

Specified by:
establishEndpoint in interface ServiceDefinition
Returns:
the established endpoint, should never return null

configure

protected abstract ServiceConfiguration configure()

getServiceNameSpaceURI

public String getServiceNameSpaceURI()

setServiceNameSpaceURI

public void setServiceNameSpaceURI(String serviceNameSpaceURI)

getMillisToLive

public Long getMillisToLive()
Description copied from interface: ServiceDefinition
Returns the maximum amount of milliseconds a message to this service can live and attempt to be processed successfully by this service before it's forced into processing by it's exception handler.

Specified by:
getMillisToLive in interface ServiceDefinition
Returns:
the maximum lifetime for this message, if null then this message has an infinite lifetime

setMillisToLive

public void setMillisToLive(Long millisToLive)

getBusSecurity

public Boolean getBusSecurity()
Description copied from interface: ServiceDefinition
Returns true if this service is secured by standard KSB security features.

Specified by:
getBusSecurity in interface ServiceDefinition
Returns:
true if this service is secured, false otherwise

setBusSecurity

public void setBusSecurity(Boolean busSecurity)

getServicePath

public String getServicePath()
Description copied from interface: ServiceDefinition
Returns the url path to export the service under.

Specified by:
getServicePath in interface ServiceDefinition
Returns:
the servicePath

setServicePath

public void setServicePath(String servicePath)
Parameters:
servicePath - the servicePath to set

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.