public Enumeration<URL> run() { try { return classLoader.getResources(compositeURI); } catch (IOException e) { throw new ServiceRuntimeException(e); } } });
public Class<?> run() { try { return Class.forName(fault.faultBean(), false, cls.getClassLoader()); } catch (ClassNotFoundException e) { throw new ServiceRuntimeException(e); } } });
public <T> T getService(Class<T> interfaze) { try { return serviceResolver.resolve(interfaze); } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } }
public <T> T getChannel(Class<T> interfaze, String name) { try { return channelResolver.getProducer(interfaze, name); } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } }
public Domain deploy(Composite composite) { try { provisioner.deploy(composite); return this; } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } }
public Domain deploy(Composite composite) { try { provisioner.deploy(composite); return this; } catch (DeploymentException e) { throw new ServiceRuntimeException(e); } }
public Domain undeploy(QName name) { try { provisioner.undeploy(name); return this; } catch (DeploymentException e) { throw new ServiceRuntimeException(e); } }
public Class<B> getBusinessInterface() { try { resolve(); return businessInterface; } catch (Exception e) { throw new ServiceRuntimeException(e); } }
public Domain deploy(Component<?> component) { try { provisioner.deploy(component); return this; } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } }
public Domain deploy(Channel channel) { try { provisioner.deploy(channel); return this; } catch (Fabric3Exception e) { throw new ServiceRuntimeException(e); } } }
public EndpointReference readEndpointReference(String xml) { try { XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml)); EndpointReference result = refProcessor.read(reader, new ProcessorContext(registry)); reader.close(); return result; } catch (Exception e) { throw new ServiceRuntimeException(e); } }
public <B> B getService(Class<B> interfaze, String referenceName) { try { return interfaze.cast(getSession().getAttribute(referenceName)); } catch (Fabric3RuntimeException e) { throw new ServiceRuntimeException(e.getMessage(), e); } }
/** * @param propValue * @param destType T[] * @return array of component type */ private static Object asArray(Object propValue, Class<?> destType) { if (DataConverter.isConvertable(propValue, destType)) { return DataConverter.convert(propValue, destType); } else { String objectClass = (propValue == null) ? "null" : propValue.getClass().getName(); throw new ServiceRuntimeException("Cannot convert " + objectClass); } }
/** * @param propValue * @param destType T[] * @return array of component type */ private static Object asArray(Object propValue, Class<?> destType) { if (DataConverter.isConvertable(propValue, destType)) { return DataConverter.convert(propValue, destType); } else { String objectClass = (propValue == null) ? "null" : propValue.getClass().getName(); throw new ServiceRuntimeException("Cannot convert " + objectClass); } }
public <B> B getService(Class<B> businessInterface, String serviceName) { ServiceReference<B> serviceReference = getServiceReference(businessInterface, serviceName); if (serviceReference == null) { throw new ServiceRuntimeException("Service not found: " + serviceName); } return serviceReference.getService(); }
public B getService() { try { resolve(); return getProxy(); } catch (Exception e) { throw new ServiceRuntimeException(e); } }
public Domain undeploy(URL url) { try { URI uri = url.toURI(); domain.undeploy(uri); contributionService.uninstall(uri); contributionService.remove(uri); return this; } catch (URISyntaxException | Fabric3Exception e) { throw new ServiceRuntimeException(e); } }
public Message invoke(Message msg) { Object body = msg.getBody(); if (body == null || !body.getClass().isArray()) { return next.invoke(msg); } Object[] payload = (Object[]) body; if (payload.length != 1) { throw new ServiceRuntimeException("Unexpected payload size: " + payload.length); } msg.setBody(payload[0]); return next.invoke(msg); }
public void stop() { rmiHost.unregisterService(binding.getURI()); try { UnicastRemoteObject.unexportObject(rmiProxy, false); } catch (NoSuchObjectException e) { throw new ServiceRuntimeException(e); } }
@Override public Message invoke(Message msg) { try { return invokeResponse(getNext().invoke(invokeRequest(msg))); } catch (Exception e) { throw new ServiceRuntimeException(e); } }