/** * {@inheritDoc} * * @see com.dinstone.jrpc.endpoint.ServiceImporter#importService(java.lang.Class, * java.lang.String, int) */ @Override public <T> T importService(Class<T> sic, String group, int timeout) { try { ServiceProxy<T> wrapper = serviceStubFactory.create(sic, group, timeout, null); referenceBinding.bind(wrapper, endpointConfig); return wrapper.getInstance(); } catch (Exception e) { throw new RuntimeException("can't import service", e); } }
/** * {@inheritDoc} * * @see com.dinstone.jrpc.endpoint.ServiceImporter#destroy() */ @Override public void destroy() { if (serviceStubFactory != null) { serviceStubFactory.destroy(); } }