merged from trunk
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/common/common-gcore-stubs/1.0@68087 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
447836557d
commit
bf45dfc898
|
@ -30,6 +30,22 @@ class StubCache {
|
|||
//holds key locks for LRU map
|
||||
private ConcurrentHashMap<QName,Lock> nameLocks = new ConcurrentHashMap<QName, Lock>();
|
||||
|
||||
void clear(QName name) {
|
||||
|
||||
//obtain a lock for current key
|
||||
Lock nameLock = lockFor(name);
|
||||
|
||||
try {
|
||||
|
||||
cache.remove(name);
|
||||
}
|
||||
finally {
|
||||
nameLock.unlock();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Service get(QName name,Callable<Service> task) {
|
||||
|
||||
//obtain a lock for current key
|
||||
|
|
|
@ -112,7 +112,14 @@ public class StubFactory<T> implements StubFactoryDSL.AtClause<T> {
|
|||
registerHandler(provider, target);
|
||||
|
||||
return stub;
|
||||
} catch (Exception e) {
|
||||
|
||||
} catch (Error e) { //bad stubs/wsdls cause java.lang.Errors
|
||||
|
||||
cache.clear(target.qName()); //clear cache
|
||||
|
||||
throw new RuntimeException("could not configure discovery service", e);
|
||||
|
||||
} catch (Exception e) { //bad stubs can cause java.lang.Errors (!)
|
||||
throw new RuntimeException("could not configure discovery service", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,14 @@ import org.gcube.common.clients.stubs.jaxws.GCoreService;
|
|||
@XmlSeeAlso(Sometype.class)
|
||||
public interface StatelessStub {
|
||||
|
||||
public class AcmeConstants {
|
||||
|
||||
public static final String serviceNS = "http://acme.org";
|
||||
public static final String porttypeNS = "http://acme.org";
|
||||
public static final QName name = new QName(serviceNS,"AcmeService");
|
||||
public static final String porttypeLN = "AcmePortType";
|
||||
}
|
||||
|
||||
public static final QName name = new QName("http://acme.org/service","StatelessService");
|
||||
|
||||
public static final String porttypeNS = "http://acme.org";
|
||||
|
|
Loading…
Reference in New Issue