ServiceBeanInstance implements StatefulAstrixBean, InvocationHandler { public static <T> ServiceBeanInstance<T> create(ServiceDefinition<T> serviceDefinition, AstrixBeanKey<T> beanKey, ServiceDiscovery serviceDiscovery, ServiceBeanContext serviceBeanContext) { BeanConfiguration beanConfiguration = serviceBeanContext.getConfig().getBeanConfiguration(beanKey); return new ServiceBeanInstance<T>(serviceDefinition, beanKey, serviceDiscovery, serviceBeanContext.getServiceComponents(), serviceBeanContext.getServiceBeanProxies(), serviceBeanContext.getReactiveTypeConverter(), beanConfiguration.get(AstrixBeanSettings.AVAILABLE)); } private  ServiceBeanInstance(ServiceDefinition<T> serviceDefinition, 
								AstrixBeanKey<T> beanKey, 
								ServiceDiscovery serviceDiscovery, 
								ServiceComponentRegistry serviceComponents,
								ServiceBeanProxies beanProxies,
								ReactiveTypeConverter reactiveTypeConverter, DynamicBooleanProperty available); static ServiceBeanInstance<T> create(ServiceDefinition<T> serviceDefinition, 
													AstrixBeanKey<T> beanKey, 
													ServiceDiscovery serviceDiscovery, 
													ServiceBeanContext serviceBeanContext); void renewLease(); void bind(); @Override void waitUntilBound(long timeoutMillis); boolean isBound(); AstrixBeanKey<T> getBeanKey(); @Override Object invoke(Object proxy, Method method, Object[] args);  }
@Test public void itsPossibleToSetBeanInInactiveStateUsingBeanSettings() throws Exception { InMemoryServiceRegistry serviceRegistry = new InMemoryServiceRegistry(); serviceRegistry.registerProvider(Ping.class, new PingImpl()); TestAstrixConfigurer astrixConfigurer = new TestAstrixConfigurer(); astrixConfigurer.registerApiProvider(PingApiProvider.class); astrixConfigurer.set(AstrixSettings.SERVICE_REGISTRY_URI, serviceRegistry.getServiceUri()); astrixContext = astrixConfigurer.configure(); final Ping ping = astrixContext.getBean(Ping.class); assertEquals("foo", ping.ping("foo")); astrixConfigurer.set(AstrixBeanSettings.AVAILABLE, AstrixBeanKey.create(Ping.class), false); AstrixTestUtil.assertThrows(() -> ping.ping("foo"), ServiceUnavailableException.class); }