org.apache.tuscany.sca.binding.notification
Class NotificationServiceBindingProvider

java.lang.Object
  extended by org.apache.tuscany.sca.binding.notification.NotificationServiceBindingProvider
All Implemented Interfaces:
NotificationServlet.NotificationServletStreamHandler, ServiceBindingProvider

public class NotificationServiceBindingProvider
extends java.lang.Object
implements ServiceBindingProvider, NotificationServlet.NotificationServletStreamHandler

The runtime representation of the local service binding


Constructor Summary
NotificationServiceBindingProvider(NotificationBinding notificationBinding, RuntimeComponent component, RuntimeComponentService service, ServletHost servletHost, NotificationTypeManager ntm, EncodingRegistry encodingRegistry, java.lang.String httpUrl, NotificationBrokerManager brokerManager)
           
 
Method Summary
 void deployBroker(java.lang.String brokerID, EndpointReference brokerProducerEPR, java.util.List<EndpointReference> producerList)
           
 void deployConsumer()
           
 NotificationBinding getBinding()
           
 InterfaceContract getBindingInterfaceContract()
          Get the effective interface contract imposed by the binding.
 java.net.URL getURL()
           
 void handle(java.util.Map<java.lang.String,java.lang.String> headers, ServletInputStream istream, int contentLength, ServletOutputStream ostream)
           
protected  void invoke(InvocationChain chain, java.lang.Object[] args)
           
 boolean isStarted()
           
 void replaceBrokerConnection(EndpointReference chosenBrokerProducerEpr)
           
 void start()
          This method will be invoked when the component service binding is activated.
 void stop()
          This method will be invoked when the component service binding is deactivated.
protected  void subscribeWithProducer(java.net.URL producerUrl, java.lang.String brokerID, org.apache.tuscany.sca.binding.notification.NotificationServiceBindingProvider.WriteableSubscribe ws)
           
 boolean supportsOneWayInvocation()
          For bindings that invoke one-way callback operations asynchronously, there is no need to perform a thread switch before calling the invoker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationServiceBindingProvider

public NotificationServiceBindingProvider(NotificationBinding notificationBinding,
                                          RuntimeComponent component,
                                          RuntimeComponentService service,
                                          ServletHost servletHost,
                                          NotificationTypeManager ntm,
                                          EncodingRegistry encodingRegistry,
                                          java.lang.String httpUrl,
                                          NotificationBrokerManager brokerManager)
Method Detail

getBinding

public NotificationBinding getBinding()

isStarted

public boolean isStarted()

getURL

public java.net.URL getURL()

getBindingInterfaceContract

public InterfaceContract getBindingInterfaceContract()
Description copied from interface: ServiceBindingProvider
Get the effective interface contract imposed by the binding. For example, it will be interface contract introspected from the WSDL portType used by the endpoint for a WebService binding.

Specified by:
getBindingInterfaceContract in interface ServiceBindingProvider
Returns:
The effective interface contract, if null is returned, the interface contract for the component service will be used

supportsOneWayInvocation

public boolean supportsOneWayInvocation()
Description copied from interface: ServiceBindingProvider
For bindings that invoke one-way callback operations asynchronously, there is no need to perform a thread switch before calling the invoker. This method indicates whether the binding has this capability.

Specified by:
supportsOneWayInvocation in interface ServiceBindingProvider
Returns:
true if the callback invoker is able to invoke one-way operations asynchronously, false if all invocations are synchronous

start

public void start()
Description copied from interface: ServiceBindingProvider
This method will be invoked when the component service binding is activated.

Specified by:
start in interface ServiceBindingProvider

stop

public void stop()
Description copied from interface: ServiceBindingProvider
This method will be invoked when the component service binding is deactivated.

Specified by:
stop in interface ServiceBindingProvider

deployConsumer

public void deployConsumer()

subscribeWithProducer

protected void subscribeWithProducer(java.net.URL producerUrl,
                                     java.lang.String brokerID,
                                     org.apache.tuscany.sca.binding.notification.NotificationServiceBindingProvider.WriteableSubscribe ws)

deployBroker

public void deployBroker(java.lang.String brokerID,
                         EndpointReference brokerProducerEPR,
                         java.util.List<EndpointReference> producerList)

replaceBrokerConnection

public void replaceBrokerConnection(EndpointReference chosenBrokerProducerEpr)

handle

public void handle(java.util.Map<java.lang.String,java.lang.String> headers,
                   ServletInputStream istream,
                   int contentLength,
                   ServletOutputStream ostream)
Specified by:
handle in interface NotificationServlet.NotificationServletStreamHandler

invoke

protected void invoke(InvocationChain chain,
                      java.lang.Object[] args)