55 lines
1.9 KiB
Java
55 lines
1.9 KiB
Java
package org.gcube.common.clients.gcore.builders;
|
|
|
|
import javax.xml.ws.wsaddressing.W3CEndpointReference;
|
|
|
|
import org.apache.axis.message.addressing.EndpointReferenceType;
|
|
import org.gcube.common.clients.builders.AbstractSingletonBuilder;
|
|
import org.gcube.common.clients.cache.EndpointCache;
|
|
import org.gcube.common.clients.config.Property;
|
|
import org.gcube.common.clients.delegates.ProxyPlugin;
|
|
import org.gcube.common.clients.gcore.Utils;
|
|
import org.gcube.common.clients.gcore.plugins.Plugin;
|
|
import org.gcube.common.clients.gcore.plugins.PluginAdapter;
|
|
import org.gcube.common.clients.gcore.queries.GCoreQuery;
|
|
|
|
/**
|
|
* Proxy builders for singleton gCore services.
|
|
*
|
|
* @author Fabio Simeoni
|
|
*
|
|
* @param <S> the type of service stubs
|
|
* @param <P> the type of service proxies
|
|
*/
|
|
public final class SingletonBuilderImpl<S,P> extends AbstractSingletonBuilder<EndpointReferenceType,S,P> implements SingletonBuilder<P> {
|
|
|
|
/**
|
|
* Constructs an instance with a given {@link ProxyPlugin} and zero or more default {@link Property}s.
|
|
* @param plugin the {@link Plugin}
|
|
* @param properties the properties
|
|
*/
|
|
public SingletonBuilderImpl(Plugin<S,P> plugin,Property<?> ... properties) {
|
|
this(plugin,GCoreQuery.globalCache,properties);
|
|
}
|
|
|
|
/**
|
|
* Constructs an instance with a given {@link ProxyPlugin}, an {@link EndpointCache}, and zero or more default {@link Property}s.
|
|
* @param plugin the {@link Plugin}
|
|
* @param cache the cache
|
|
* @param properties the properties
|
|
*/
|
|
public SingletonBuilderImpl(Plugin<S,P> plugin,EndpointCache<EndpointReferenceType> cache,Property<?> ... properties) {
|
|
super(new PluginAdapter<S,P>(plugin),cache,properties);
|
|
}
|
|
|
|
@Override
|
|
protected EndpointReferenceType convertAddress(W3CEndpointReference address) {
|
|
return Utils.convert(address);
|
|
}
|
|
|
|
@Override
|
|
protected String contextPath() {
|
|
return Utils.GCORE_CONTEXTPATH;
|
|
}
|
|
|
|
}
|