
org.fabric3.implementation.pojo.spi.proxy.WireProxyServiceExtension Maven / Gradle / Ivy
The newest version!
/*
* Fabric3
* Copyright (c) 2009-2015 Metaform Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Portions originally based on Apache Tuscany 2007
* licensed under the Apache 2.0 license.
*/
package org.fabric3.implementation.pojo.spi.proxy;
import java.net.URI;
import org.fabric3.spi.container.objectfactory.ObjectFactory;
import org.fabric3.spi.container.wire.Wire;
import org.oasisopen.sca.ServiceReference;
/**
* Creates proxies that implement Java interfaces and invocation handlers for fronting wires.
*/
public interface WireProxyServiceExtension {
boolean isDefault();
/**
* Create an ObjectFactory that provides proxies for the forward wire.
*
* @param interfaze the interface the proxy implements
* @param wire the wire to proxy @return an ObjectFactory that will create proxies
* @param callbackUri the callback URI or null if the wire is unidirectional
* @return the factory
* @throws ProxyCreationException if there was a problem creating the proxy
*/
ObjectFactory createObjectFactory(Class interfaze, Wire wire, String callbackUri) throws ProxyCreationException;
/**
* Create an ObjectFactory that provides proxies for the callback wire.
*
* @param interfaze the interface the proxy implements
* @param multiThreaded if the proxy should be thread-safe
* @param callbackUri the callback service uri
* @param wire the wire to proxy
* @return an ObjectFactory that will create proxies
* @throws ProxyCreationException if there was a problem creating the proxy
*/
ObjectFactory createCallbackObjectFactory(Class interfaze, boolean multiThreaded, URI callbackUri, Wire wire) throws ProxyCreationException;
/**
* Updates an ObjectFactory with an additional callback wire. This is used when multiple clients are wired to a target bidirectional service.
*
* @param factory the ObjectFactory to update
* @param interfaze the interface the proxy implements
* @param multiThreaded if the proxy should be thread-safe
* @param callbackUri the callback service uri
* @param wire the wire to proxy
* @return an ObjectFactory that will create proxies
* @throws ProxyCreationException if there was a problem creating the proxy
*/
ObjectFactory> updateCallbackObjectFactory(ObjectFactory> factory, Class interfaze, boolean multiThreaded, URI callbackUri, Wire wire)
throws ProxyCreationException;
/**
* Cast a proxy to a ServiceReference.
*
* @param target a proxy generated by this implementation
* @return a ServiceReference equivalent to this proxy
* @throws IllegalArgumentException if the object supplied is not a proxy
*/
> R cast(B target) throws IllegalArgumentException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy