/** * Return an instance for a single use. <b>IMPORTANT: </b> users * should not hold on to the instance returned. They should always get a fresh instance. * * @return the instance to use * @throws Exception any errors */ @Override public ServiceInstance<T> getInstance() throws Exception { return providerStrategy.getInstance(instanceProvider); }
/** * Return an instance for a single use. <b>IMPORTANT: </b> users * should not hold on to the instance returned. They should always get a fresh instance. * * @return the instance to use * @throws Exception any errors */ @Override public ServiceInstance<T> getInstance() throws Exception { return providerStrategy.getInstance(instanceProvider); }
@Override public ServiceInstance<T> getInstance() throws Exception { return providerStrategy.getInstance(instanceProvider); }
@Override public UnitInstance lb(String name) { try { ServiceInstance<UnitProxy> instance = serviceProviders.get(name).getInstance(); if (instance == null) instance = serviceProviders.get(name).getProviderStrategy() .getInstance(nonCachedInstanceProviders.get(name)); return ZkServiceInstanceAdaptor.unitInstance(instance); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public GroupInstance lb(String name) { try { ServiceInstance<GroupProxy> instance = serviceProviders.get(name).getInstance(); if (instance == null) instance = serviceProviders.get(name).getProviderStrategy() .getInstance(nonCachedInstanceProviders.get(name)); return ZkServiceInstanceAdaptor.groupInstance(instance); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public ApplicationInstance lb(String name) { try { ServiceInstance<NodeStatus> serviceInstance = serviceProviders.get(name).getInstance(); if (serviceInstance == null) { serviceInstance = serviceProviders.get(name).getProviderStrategy() .getInstance(nonCachedInstanceProviders.get(name)); } return ZkServiceInstanceAdaptor.applicationInstance(serviceInstance); } catch (Exception e) { throw new RuntimeException(e); } }
ServiceInstance<T> instance = masterStrategy.getInstance
ServiceInstance<T> instance = masterStrategy.getInstance
ServiceInstance<?> randomInstance = context.getProviderStrategy().getInstance