Commit 50107160 authored by seinturi's avatar seinturi

Artifacts for the OSOA and SCA APIs.

The artifacts were previously deployed in an FraSCAti nexus OW2 repository that seems to be no longer available.
parent cf505726
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
import java.util.Collection;
/**
* The ComponentContext interface is used to obtain contextual information
* about the SCA component which is executing at the time the API is
* invoked.
*
* <p>Note: An SCA component can obtain a service reference either through
* injection or programmatically through the ComponentContext API. Using
* reference injection is the recommended way to access a service, since it
* results in code with minimal use of middleware APIs. The ComponentContext
* API is provided for use in cases where reference injection is not possible.
*/
public interface ComponentContext {
/**
* Returns the absolute URI of the component within the SCA domain.
*
* @return the absolute URI of the component within the SCA domain.
*/
String getURI();
/**
* Returns a typed service proxy object for a reference defined by the
* current component, where the reference has multiplicity 0..1 or 1..1.
*
* @param <B> the Java type that is implemented by the returned proxy
* object.
* @param businessInterface the Class object for the Java type that
* is implemented by the returned proxy object.
* @param referenceName the name of the service reference.
* @return a proxy for the reference defined by the current component.
* Returns null if the named reference has no target service
* configured.
* @exception IllegalArgumentException if the reference has multiplicity
* greater than one, or the component does not have the reference
* named by <code>referenceName</code>, or the interface of the named
* reference is not compatible with the interface supplied in
* the <code>businessInterface</code> parameter.
*/
<B> B getService(Class<B> businessInterface, String referenceName)
throws IllegalArgumentException;
/**
* Returns a ServiceReference object for a reference defined by the current
* component, where the reference has multiplicity 0..1 or 1..1.
*
* @param <B> the Java type of the reference that is associated with
* the returned object.
* @param businessInterface the Class object for the Java type that
* is associated with the returned object.
* @param referenceName the name of the service reference.
* @return a ServiceReference object for a reference defined by the current
* component, where the reference has multiplicity 0..1 or 1..1.
* Returns null if the named reference has no target service
* configured.
* @exception IllegalArgumentException if the reference has multiplicity
* greater than one, or the component does not have the reference
* named by <code>referenceName</code>, or the interface of the named
* reference is not compatible with the interface supplied in
* the <code>businessInterface</code> parameter.
*/
<B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
String referenceName)
throws IllegalArgumentException;
/**
* Returns a list of typed service proxies for a reference defined by the current
* component, where the reference has multiplicity 0..n or 1..n.
*
* @param <B> the Java type that is implemented by the returned proxy
* objects.
* @param businessInterface the Class object for the Java type that
* is implemented by the returned proxy objects.
* @param referenceName the name of the service reference.
* @return a collection of proxy objects for the reference, one for each target
* service to which the reference is wired, where each proxy object
* implements the interface B contained in the
* <code>businessInterface</code> parameter. The collection is empty if the
* reference is not wired to any target services.
* @exception IllegalArgumentException if the reference has multiplicity
* greater other than 0..1 or 1..1, or the component does not have the reference
* named by <code>referenceName</code>, or the interface of the named
* reference is not compatible with the interface supplied in
* the <code>businessInterface</code> parameter.
*/
<B> Collection<B> getServices(Class<B> businessInterface,
String referenceName)
throws IllegalArgumentException;
/**
* Returns a list of typed ServiceReference objects for a reference defined by the current
* component, where the reference has multiplicity 0..n or 1..n.
*
* @param <B> the Java type that is associated with returned proxy
* objects.
* @param <B> the Java type of the reference that is associated with
* the returned object.
* @param referenceName the name of the service reference.
* @return a collection of ServiceReference objects for the reference, one for each target
* service to which the reference is wired, where each proxy object implements
* the interface B contained in the <code>businessInterface</code> parameter.
* The collection is empty if the reference is not wired to any target services.
* @exception IllegalArgumentException if the reference has multiplicity
* greater other than 0..1 or 1..1, or the component does not have the reference
* named by <code>referenceName</code>, or the interface of the named
* reference is not compatible with the interface supplied in
* the <code>businessInterface</code> parameter.
*/
<B> Collection<ServiceReference<B>> getServiceReferences(
Class<B> businessInterface, String referenceName)
throws IllegalArgumentException;
/**
* Returns a ServiceReference that can be used to invoke this component
* over the designated service.
*
* @param <B> the Java type of the reference that is associated with
* the returned object.
* @param businessInterface the Class object for the Java type that
* is associated with the returned object.
* @return a ServiceReference that can be used to invoke this
* component over the designated service.
* @exception IllegalArgumentException if the component does not have a service
* which implements the interface identified by the <code>
* businessinterface</code> parameter.
*/
<B> ServiceReference<B> createSelfReference(Class<B> businessInterface)
throws IllegalArgumentException;
/**
* Returns a ServiceReference that can be used to invoke this component
* over the designated service. The <code>serviceName</code> parameter explicitly names
* the service with which the returned ServiceReference is associated.
*
* @param <B> the Java type of the reference that is associated with
* the returned object.
* @param businessInterface the Class object for the Java type that
* is associated with the returned object.
* @param serviceName the service name with which the returned ServiceReference
* is associated.
* @return a ServiceReference that can be used to invoke this component
* over the designated service.
* @exception IllegalArgumentException if the component does not have a service
* with the name identified by the <code>serviceName</code> parameter, or
* if the named service does not implement the interface identified by the
* <code>businessinterface</code> parameter.
*/
<B> ServiceReference<B> createSelfReference(Class<B> businessInterface,
String serviceName)
throws IllegalArgumentException;
/**
* Returns the value of an SCA property defined by this component.
*
* @param <B> the property type.
* @param type the Class object for the property type.
* @param propertyName the property name.
* @return The value of an SCA property defined by this component, or null if
* the property is not configured.
* @exception IllegalArgumentException if the component does not have a property
* with the name identified by the <code>propertyName</code> parameter, or
* if the named property type is not compatible with the <code>type</code>
* parameter.
*/
<B> B getProperty(Class<B> type, String propertyName)
throws IllegalArgumentException;
/**
* Casts a type-safe reference to a ServiceReference.
*
* @param <B> the Java type of the reference that is associated with
* the returned object.
* @param target the type-safe reference proxy that implements interface <B>.
* @return a type-safe reference to a ServiceReference.
*/
<B> ServiceReference<B> cast(B target)
throws IllegalArgumentException;
/**
* Returns the RequestContext for the current SCA service request.
*
* @return the RequestContext for the current SCA service request when
* invoked during the execution of a component service method or
* callback method. Returns null in all other cases.
*/
RequestContext getRequestContext();
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* The SCA Constants interface defines a number of constant values
* that are used in the SCA Java APIs and Annotations.
*
* <p> The serialized QNames are used with the @Requires annotation
* to specify a policy intent. The policy intent strings in this
* interface do not have a corresponding Java annotation, so these
* policy intents have to be specified through the use of the
* @Requires annotation.
*/
public interface Constants {
/**
* The SCA V1.1 namespace.
*/
String SCA_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912";
/**
* The serialized form of the SCA namespace for construction of QNames.
*/
String SCA_PREFIX = "{"+SCA_NS+"}";
/**
* The serialized QName of the serverAuthentication policy intent.
*/
String SERVERAUTHENTICATION = SCA_PREFIX + "serverAuthentication";
/**
* The serialized QName of the clientAuthentication policy intent.
*/
String CLIENTAUTHENTICATION = SCA_PREFIX + "clientAuthentication";
/**
* The serialized QName of the atleastOnce policy intent.
*/
String ATLEASTONCE = SCA_PREFIX + "atLeastOnce";
/**
* The serialized QName of the atMostOnce policy intent.
*/
String ATMOSTONCE = SCA_PREFIX + "atMostOnce";
/**
* The serialized QName of the exactlyOnce policy intent.
*/
String EXACTLYONCE = SCA_PREFIX + "exactlyOnce";
/**
* The serialized QName of the ordered policy intent.
*/
String ORDERED = SCA_PREFIX + "ordered";
/**
* The serialized QName of the transactedOneWay policy intent.
*/
String TRANSACTEDONEWAY = SCA_PREFIX + "transactedOneWay";
/**
* The serialized QName of the immediateOneWay policy intent.
*/
String IMMEDIATEONEWAY = SCA_PREFIX + "immediateOneWay";
/**
* The serialized QName of the propagatesTransaction policy intent.
*/
String PROPAGATESTRANSACTION = SCA_PREFIX + "propagatesTransaction";
/**
* The serialized QName of the suspendsTransaction policy intent.
*/
String SUSPENDSTRANSACTION = SCA_PREFIX + "suspendsTransaction";
/**
* The serialized QName of the asyncInvocation policy intent.
*/
String ASYNCINVOCATION = SCA_PREFIX + "asyncInvocation";
/**
* The serialized QName of the SOAP policy intent.
*/
String SOAP = SCA_PREFIX + "SOAP";
/**
* The serialized QName of the JMS policy intent.
*/
String JMS = SCA_PREFIX + "JMS";
/**
* The serialized QName of the noListener policy intent.
*/
String NOLISTENER = SCA_PREFIX + "noListener";
/**
* The serialized QName of the EJB policy intent.
*/
String EJB = SCA_PREFIX + "EJB";
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* This exception signals that the ServiceReference is no longer valid.
* This can happen when the target of the reference is undeployed.
*
* This exception is not transient and therefore is unlikely to be
* resolved by retrying the operation and will most likely require
* human intervention.
*/
public class InvalidServiceException extends ServiceRuntimeException {
/**
* Constructs a InvalidServiceException with no detail message.
*/
public InvalidServiceException() {
super();
}
/**
* Constructs a InvalidServiceException with the specified detail
* message.
*
* @param message the detail message
*/
public InvalidServiceException(String message) {
super(message);
}
/**
* Constructs a InvalidServiceException with the specified detail
* message and cause.
*
* The detail message associated with <code>cause</code> is not
* automatically incorporated in this exception's detail message.
*
* @param message the detail message
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public InvalidServiceException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a InvalidServiceException with the specified cause and
* a detail message of <tt>(cause==null ? null : cause.toString())</tt>.
*
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public InvalidServiceException(Throwable cause) {
super(cause);
}
private static final long serialVersionUID = 7520492728695222145L;
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* This exception signals that the given SCA Domain does not exist.
*/
public class NoSuchDomainException extends Exception {
/**
* Constructs a NoSuchDomainException with no detail message.
*/
public NoSuchDomainException() {
super();
}
/**
* Constructs a NoSuchDomainException with the specified detail
* message.
*
* @param message the detail message
*/
public NoSuchDomainException(String message) {
super(message);
}
/**
* Constructs a NoSuchDomainException with the specified detail
* message and cause.
*
* The detail message associated with <code>cause</code> is not
* automatically incorporated in this exception's detail message.
*
* @param message the detail message
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public NoSuchDomainException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a NoSuchDomainException with the specified cause and a
* detail message of <tt>(cause==null ? null : cause.toString())</tt>.
*
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public NoSuchDomainException(Throwable cause) {
super(cause);
}
private static final long serialVersionUID = 6761623124602414622L;
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* This exception signals that the given SCA service does not exist.
*/
public class NoSuchServiceException extends Exception {
/**
* Constructs a NoSuchServiceException with no detail message.
*/
public NoSuchServiceException() {
super();
}
/**
* Constructs a NoSuchServiceException with the specified detail
* message.
*
* @param message the detail message
*/
public NoSuchServiceException(String message) {
super(message);
}
/**
* Constructs a NoSuchServiceException with the specified detail
* message and cause.
*
* The detail message associated with <code>cause</code> is not
* automatically incorporated in this exception's detail message.
*
* @param message the detail message
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public NoSuchServiceException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a NoSuchServiceException with the specified cause and a
* detail message of <tt>(cause==null ? null : cause.toString())</tt>.
*
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public NoSuchServiceException(Throwable cause) {
super(cause);
}
private static final long serialVersionUID = 6761623124602414622L;
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
import javax.security.auth.Subject;
/**
* The RequestContext interface is used to obtain information about
* the service invocation which is executing when one of the
* RequestContext methods is called.
*/
public interface RequestContext {
/**
* Returns the JAAS Subject of the current request.
*
* @return The JAAS (javax.security.auth.Subject) Subject of the
* current request. Returns null if there is no JAAS
* Subject.
*/
Subject getSecuritySubject();
/**
* Returns the name of the service under which the current service
* method is executing.
*
* @return the name of the service under which the current service
* operation is executing, or null if called outside of the
* execution of a service method.
*/
String getServiceName();
/**
* Returns a service reference for the callback for the invoked service
* operation, as specified by the service caller.
*
* @param <CB> the Java interface type of the callback.
* @return a service reference for the callback as specified by
* the service caller. Returns null when called for a service
* request whose interface is not bidirectional, or when called
* during execution of a callback request, or when called outside
* the execution of a service method.
*/
<CB> ServiceReference<CB> getCallbackReference();
/**
* Returns a proxy for the callback for the invoked service as specified
* by the service client.
*
* @param <CB> the type of the callback proxy
* @return a proxy for the callback for the invoked service as specified
* by the service client. Returns null when called during the
* execution of a service method whose interface is not
* bidirectional, or when called during the execution of a
* callback request, or when called outside the execution of a
* service method.
*/
<CB> CB getCallback();
/**
* Returns a ServiceReference object for the service that is executing.
*
* @param <B> the Java interface type associated with the service reference.
* @return the ServiceReference representing the service or callback
* that is executing. Returns null if when called outside the
* execution of a service method.
*/
<B> ServiceReference<B> getServiceReference();
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
import java.util.Map;
/**
*
* The following defines the ResponseDispatch interface, used to return a response
* message asynchronously from a service implementation method.
*
* @param <T> the type of the Response message returned by the service implementation method
*/
public interface ResponseDispatch<T> {
/**
* Sends the response message from an asynchronous service method.
* This method can only be invoked once for a given ResponseDispatch object and cannot be invoked
* if sendFault has previously been invoked for the same ResponseDispatch object.
* @param res an instance of the response message returned by the service operation
* @exception InvalidStateException if this method is called more than once for the same service
* operation.
*/
void sendResponse(T res);
/**
* Sends an exception as a fault from an asynchronous service method.
* This method can only be invoked once for a given ResponseDispatch object and cannot be invoked
* if sendResponse has previously been invoked for the same ResponseDispatch object.
* @param e an instance of an exception returned by the service operation
* @exception InvalidStateException if this method is called more than once for the same service
* operation.
*/
void sendFault(Throwable e);
/**
* Obtains the context object for the ResponseDispatch method
* @return a Map which is is the context object for the ResponseDispatch object.
* The invoker can update the context object with appropriate context information, prior to invoking
* either the sendResponse method or the sendFault method
*/
Map<String, Object> getContext();
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* The ServiceReference interface represents a component reference.
* It can be injected using the @Reference annotation
* on a field, a setter method, or constructor parameter taking the
* type ServiceReference.
*
* @param <B> the type of the service reference
*/
public interface ServiceReference<B> extends java.io.Serializable {
/**
* Returns a type-safe reference to the target of this reference.
* The instance returned is guaranteed to implement the business
* interface for this reference. The value returned is a proxy
* to the target that implements the business interface associated
* with this reference.
*
* @return a type-safe reference to the target of this reference.
*/
B getService();
/**
* Returns the Java class for the business interface associated
* with this reference.
*
* @return the Java class for the business interface associated
* with this reference.
*/
Class<B> getBusinessInterface();
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* This exception signals problems in the management of SCA component execution.
*/
public class ServiceRuntimeException extends RuntimeException {
/**
* Constructs a ServiceRuntimeException with no detail message.
*/
public ServiceRuntimeException() {
super();
}
/**
* Constructs a ServiceRuntimeException with the specified detail
* message.
*
* @param message the detail message
*/
public ServiceRuntimeException(String message) {
super(message);
}
/**
* Constructs a ServiceRuntimeException with the specified detail
* message and cause.
*
* The detail message associated with <code>cause</code> is not
* automatically incorporated in this exception's detail message.
*
* @param message the detail message
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public ServiceRuntimeException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a ServiceRuntimeException with the specified cause and a
* detail message of <tt>(cause==null ? null : cause.toString())</tt>.
*
* @param cause the cause, or null if the cause is nonexistent
* or unknown
*/
public ServiceRuntimeException(Throwable cause) {
super(cause);
}
private static final long serialVersionUID = 6761623124602414622L;
}
/*
* Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
* OASIS trademark, IPR and other policies apply.
*/
package org.oasisopen.sca;
/**
* This exception signals problems in the interaction with remote