org.gcube.common.clients.builders
Class AbstractBuilder<A,S,P>

java.lang.Object
  extended by org.gcube.common.clients.builders.AbstractBuilder<A,S,P>
Type Parameters:
A - the type of service addresses
S - the type of service stubs
P - the type of service proxies
Direct Known Subclasses:
AbstractSingletonBuilder, AbstractStatefulBuilder, AbstractStatelessBuilder

public abstract class AbstractBuilder<A,S,P>
extends Object

Partial implementation of proxy builders.

Author:
Fabio Simeoni

Field Summary
static int defaultTimeout
          Default proxy timeout.
 
Constructor Summary
protected AbstractBuilder(ProxyPlugin<A,S,P> plugin, EndpointCache<A> cache, Property<?>... properties)
          Constructs an instance with a given ProxyPlugin, and EndpointCache, and zero or more default Propertys.
 
Method Summary
protected  void addProperty(Property<?> property)
          Adds a custom property.
 P build()
           
protected abstract  String contextPath()
           
protected abstract  A convertAddress(W3CEndpointReference address)
          Converts a W3CEndpointReference in a service address.
protected  ProxyPlugin<A,S,P> plugin()
          Returns the ProxyPlugin.
protected  void setAddress(W3CEndpointReference address)
          Sets the address.
protected  void setQuery(Query<A> query)
          Sets the query.
protected  void setTimeout(int timeout)
          Sets the timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultTimeout

public static final int defaultTimeout
Default proxy timeout.

Constructor Detail

AbstractBuilder

protected AbstractBuilder(ProxyPlugin<A,S,P> plugin,
                          EndpointCache<A> cache,
                          Property<?>... properties)
Constructs an instance with a given ProxyPlugin, and EndpointCache, and zero or more default Propertys.

Parameters:
plugin - the plugin
cache - the cache
properties - the properties
Method Detail

plugin

protected ProxyPlugin<A,S,P> plugin()
Returns the ProxyPlugin.

Returns:
the plugin

setQuery

protected void setQuery(Query<A> query)
Sets the query.

Parameters:
query - the query

setTimeout

protected void setTimeout(int timeout)
Sets the timeout.

Parameters:
timeout - the timout

setAddress

protected void setAddress(W3CEndpointReference address)
Sets the address.

Parameters:
address - the address

addProperty

protected void addProperty(Property<?> property)
Adds a custom property.

Parameters:
property - the property

build

public P build()

convertAddress

protected abstract A convertAddress(W3CEndpointReference address)
Converts a W3CEndpointReference in a service address.

Parameters:
address - the address as a W3CEndpointReference
Returns:
the converted address

contextPath

protected abstract String contextPath()


Copyright © 2012. All Rights Reserved.