diff options
Diffstat (limited to '')
2 files changed, 1 insertions, 62 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java index bd30800bf9..d7a31a38ef 100644 --- a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java +++ b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java @@ -22,7 +22,6 @@ package org.apache.tuscany.sca.registry.hazelcast; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.io.StringReader; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; @@ -36,10 +35,6 @@ import java.util.concurrent.FutureTask; import java.util.logging.Level; import java.util.logging.Logger; -import javax.wsdl.Definition; -import javax.wsdl.WSDLException; -import javax.wsdl.xml.WSDLReader; -import javax.wsdl.xml.WSDLWriter; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; @@ -56,19 +51,13 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.LifeCycleListener; import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; import org.apache.tuscany.sca.runtime.BaseDomainRegistry; +import org.apache.tuscany.sca.runtime.ContributionDescription; import org.apache.tuscany.sca.runtime.ContributionListener; import org.apache.tuscany.sca.runtime.DomainRegistry; -import org.apache.tuscany.sca.runtime.ContributionDescription; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeProperties; import org.oasisopen.sca.ServiceRuntimeException; -import org.xml.sax.InputSource; import com.hazelcast.config.Config; import com.hazelcast.config.NearCacheConfig; @@ -106,7 +95,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai // key componentName, value contributionURI protected Map<String, String> runningComponentContributions; - protected Map<Object, Object> endpointWsdls; protected Map<String, Endpoint> localEndpoints = new ConcurrentHashMap<String, Endpoint>(); protected Map<String, ContributionDescription> contributionDescriptions; @@ -147,7 +135,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai endpointMap = imap; endpointOwners = hazelcastInstance.getMultiMap(domainURI + "/EndpointOwners"); - endpointWsdls = hazelcastInstance.getMap(domainURI + "/EndpointWsdls"); runningComposites = hazelcastInstance.getMap(domainURI + "/RunningComposites"); runningCompositeOwners = hazelcastInstance.getMap(domainURI + "/RunningCompositeOwners"); @@ -182,7 +169,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai hazelcastInstance = null; endpointMap = null; endpointOwners = null; - endpointWsdls = null; runningComposites = null; runningCompositeOwners = null; } @@ -290,7 +276,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString(); String endpointURI = endpoint.getURI(); - String wsdl = getWsdl(endpoint); String componentName = endpoint.getComponent().getName(); String curi = null; if (endpoint instanceof RuntimeEndpoint) { @@ -304,7 +289,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai try { localEndpoints.put(endpointURI, endpoint); endpointMap.put(endpointURI, endpoint); - endpointWsdls.put(endpointURI, wsdl); endpointOwners.put(localMemberAddr, endpointURI); if (curi != null) { runningComponentContributions.put(componentName, curi); @@ -317,23 +301,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai logger.info("Add endpoint - " + endpoint); } - private String getWsdl(Endpoint endpoint) { - WSDLInterfaceContract wsdlIC = (WSDLInterfaceContract)((RuntimeEndpoint)endpoint).getGeneratedWSDLContract(endpoint.getComponentServiceInterfaceContract()); - if (wsdlIC == null) { - return ""; - } - WSDLInterface wsdl = (WSDLInterface)wsdlIC.getInterface(); - WSDLDefinition d = wsdl.getWsdlDefinition(); - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - try { - WSDLWriter writer = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter(); - writer.writeWSDL(d.getDefinition(), outStream); - } catch (Exception e){ - throw new RuntimeException(e); - } - return outStream.toString(); - } - public List<Endpoint> findEndpoint(String uri) { List<Endpoint> foundEndpoints = new ArrayList<Endpoint>(); for (Object v : endpointMap.values()) { @@ -353,11 +320,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai if (!isLocal(endpoint)) { endpoint.setRemote(true); ((RuntimeEndpoint)endpoint).bind(registry, this); - try { - setNormailizedWSDLContract(endpoint); - } catch (WSDLException e) { - throw new RuntimeException(e); - } } else { // get the local version of the endpoint // this local version won't have been serialized @@ -368,25 +330,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai return endpoint; } - private void setNormailizedWSDLContract(Endpoint endpoint) throws WSDLException { - String wsdl = endpointWsdls == null ? null : (String)endpointWsdls.get(endpoint.getURI()); - if (wsdl == null || wsdl.length() < 1) { - return; - } - InterfaceContract ic = endpoint.getComponentServiceInterfaceContract(); - WSDLFactory wsdlFactory = registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(WSDLFactory.class); - WSDLInterfaceContract wsdlIC = wsdlFactory.createWSDLInterfaceContract(); - WSDLInterface wsdlIface = wsdlFactory.createWSDLInterface(); - WSDLDefinition wsdlDef = wsdlFactory.createWSDLDefinition(); - WSDLReader reader = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader(); - InputSource inputSource = new InputSource(new StringReader(wsdl)); - Definition def = reader.readWSDL("", inputSource); - wsdlDef.setDefinition(def); - wsdlIface.setWsdlDefinition(wsdlDef); - wsdlIC.setInterface(wsdlIface); - ic.setNormailizedWSDLContract(wsdlIC); - } - private boolean isLocal(Endpoint endpoint) { return localEndpoints.containsKey(endpoint.getURI()); } @@ -416,7 +359,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai try { endpointOwners.remove(localMemberAddr, endpointURI); endpointMap.remove(endpointURI); - endpointWsdls.remove(endpointURI); runningComponentContributions.remove(componentName); txn.commit(); } catch (Throwable e) { @@ -486,7 +428,6 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai for (Object k : keys) { Endpoint endpoint = (Endpoint)endpointMap.remove(k); runningComponentContributions.remove(endpoint.getComponent().getName()); - endpointWsdls.remove(k); } } if (runningCompositeOwners.containsKey(memberAddr)) { diff --git a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/client/HazelcastClientEndpointRegistry.java b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/client/HazelcastClientEndpointRegistry.java index 05fc47b884..972bd43075 100644 --- a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/client/HazelcastClientEndpointRegistry.java +++ b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/client/HazelcastClientEndpointRegistry.java @@ -60,7 +60,6 @@ public class HazelcastClientEndpointRegistry extends HazelcastDomainRegistry { initHazelcastClientInstance(); endpointMap = hazelcastClient.getMap(rc.getUserid() + "/Endpoints"); endpointOwners = hazelcastClient.getMultiMap(rc.getUserid() + "/EndpointOwners"); - endpointWsdls = hazelcastClient.getMap(rc.getUserid() + "/EndpointWsdls"); runningComponentContributions = hazelcastClient.getMap(rc.getUserid() + "/RunningComponentContributions"); contributionDescriptions = hazelcastClient.getMap(rc.getUserid() + "/ContributionDescriptions"); } @@ -71,7 +70,6 @@ public class HazelcastClientEndpointRegistry extends HazelcastDomainRegistry { hazelcastClient.shutdown(); hazelcastClient = null; endpointMap = null; - endpointWsdls = null; } } |