use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class ZKBackend method connect.
@Override
public RootNode connect() throws InterruptedException, ServiceLocatorException {
if (!isConnected()) {
disconnect();
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Start connect session");
}
CountDownLatch connectionLatch = new CountDownLatch(1);
zk = createZooKeeper(connectionLatch);
if (authentication) {
authenticate();
}
boolean connected = connectionLatch.await(settings.getConnectionTimeout(), TimeUnit.MILLISECONDS);
if (!connected) {
throw new ServiceLocatorException("Connection to Service Locator failed.");
}
for (PostConnectAction postConnectAction : postConnectActions) {
postConnectAction.process(null);
}
if (LOG.isLoggable(Level.FINER)) {
LOG.log(Level.FINER, "End connect session");
}
}
return rootNode;
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class CXFEndpointProvider method serializeEPR.
/**
* Inserts a marshalled endpoint reference to a given DOM tree rooted by parent.
* @param wsAddr
* @param parent
* @throws ServiceLocatorException
*/
private void serializeEPR(EndpointReferenceType wsAddr, Node parent) throws ServiceLocatorException {
try {
JAXBElement<EndpointReferenceType> ep = WSA_OBJECT_FACTORY.createEndpointReference(wsAddr);
createMarshaller().marshal(ep, parent);
} catch (JAXBException e) {
if (LOG.isLoggable(Level.SEVERE)) {
LOG.log(Level.SEVERE, "Failed to serialize endpoint data", e);
}
throw new ServiceLocatorException("Failed to serialize endpoint data", e);
}
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class EndpointTransformerImpl method serialize.
private byte[] serialize(EndpointDataType endpointData) throws ServiceLocatorException {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(50000);
try {
JAXBElement<EndpointDataType> epd = ENDPOINT_OBJECT_FACTORY.createEndpointData(endpointData);
createMarshaller().marshal(epd, outputStream);
} catch (JAXBException e) {
if (LOG.isLoggable(Level.SEVERE)) {
LOG.log(Level.SEVERE, "Failed to serialize endpoint data", e);
}
throw new ServiceLocatorException("Failed to serialize endpoint data", e);
}
return outputStream.toByteArray();
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class RemoveOperation method execute.
@Override
public Object execute() throws Exception {
ServiceLocatorTracker slt = ServiceLocatorTracker.getInstance(sl);
System.out.println();
try {
QName serviceName = slt.getServiceName(service);
sl.removeEndpoint(serviceName, endpoint);
System.out.println("Endpoint has been removed from Service Locator");
slt.updateServiceList();
} catch (ServiceLocatorException e) {
System.err.println(e.getMessage());
}
System.out.println();
return null;
}
use of org.talend.esb.servicelocator.client.ServiceLocatorException in project tesb-rt-se by Talend.
the class UnregisterOperation method execute.
@Override
public Object execute() throws Exception {
ServiceLocatorTracker slt = ServiceLocatorTracker.getInstance(sl);
System.out.println();
try {
QName serviceName = slt.getServiceName(service);
sl.unregister(serviceName, endpoint);
System.out.println("Endpoint has been unregistered at Service Locator");
} catch (ServiceLocatorException e) {
System.err.println(e.getMessage());
}
System.out.println();
return null;
}
Aggregations