1 10 11 package org.mule.providers.gs; 12 13 import org.mule.providers.gs.space.GSSpaceFactory; 14 import org.mule.providers.space.SpaceConnector; 15 import org.mule.umo.UMOComponent; 16 import org.mule.umo.endpoint.UMOEndpoint; 17 import org.mule.umo.endpoint.UMOImmutableEndpoint; 18 import org.mule.umo.space.UMOSpace; 19 import org.mule.umo.space.UMOSpaceException; 20 21 25 public class GSConnector extends SpaceConnector 26 { 27 28 private long transactionTimeout = 32 * 1000; 29 30 public GSConnector() 31 { 32 registerSupportedProtocol("rmi"); 33 registerSupportedProtocol("java"); 34 registerSupportedProtocol("jini"); 35 setSpaceFactory(new GSSpaceFactory()); 36 } 37 38 public String getProtocol() 39 { 40 return "gs"; 41 } 42 43 public long getTransactionTimeout() 44 { 45 return transactionTimeout; 46 } 47 48 public void setTransactionTimeout(long transactionTimeout) 49 { 50 this.transactionTimeout = transactionTimeout; 51 } 52 53 60 protected Object getReceiverKey(UMOComponent component, UMOEndpoint endpoint) 61 { 62 return endpoint.getEndpointURI().toString() 63 + (endpoint.getFilter() != null ? ":" + endpoint.getFilter() : ""); 64 } 65 66 76 public UMOSpace getSpace(UMOEndpoint endpoint) throws UMOSpaceException 77 { 78 return getSpaceFactory().create(endpoint); 79 } 80 81 public UMOSpace getSpace(String spaceUrl) throws UMOSpaceException 82 { 83 return getSpaceFactory().create(spaceUrl); 84 } 85 86 protected String getSpaceKey(UMOImmutableEndpoint endpoint) 87 { 88 String spaceKey = super.getSpaceKey(endpoint); 89 spaceKey += (endpoint.getFilter() != null ? '#' + endpoint.getFilter().toString() : ""); 90 return spaceKey; 91 } 92 93 } 94 | Popular Tags |