@AstrixQualifier("lunch-space-local-view") @Service(AstrixServiceComponentNames.GS_LOCAL_VIEW) @ServiceConfig(LunchLocalViewConfigurer.class) GigaSpace lunchLocalView();
@AstrixConfigDiscovery("restaurantFinderUri") @Service LunchRestaurantFinder lunchRestaurantFinder();
@AstrixApiProvider public class ServiceRegistryAdministratorLibraryProvider { @Library public ServiceRegistryAdministrator createAdministrator(AstrixServiceRegistry serviceRegistry) { return new ServiceRegistryAdministratorImpl(serviceRegistry); } }
@AstrixApplication( exportsRemoteServicesFor = { LunchGradeServiceProvider.class }, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class LunchGradeApplicationDescriptor { }
@AstrixQualifier("lunch-space") @Service(AstrixServiceComponentNames.GS) GigaSpace gigaSpace();
@AstrixServiceExport(Ping.class) public class PingBean implements Ping { @Override public String ping(String msg) { return msg; } }
@AstrixApiProvider public interface LunchServiceProvider { @Service LunchService lunchService(); }
@AstrixApplication( exportsRemoteServicesFor = { LunchGradeServiceProvider.class }, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class LunchGradeApplicationDescriptor { }
@AstrixConfigDiscovery(AstrixSettings.SERVICE_REGISTRY_URI_PROPERTY_NAME) @Versioned @Service AstrixServiceRegistry serviceRegistry(); }
@AstrixServiceExport(ServiceAdministrator.class) public class ServiceAdministratorImpl implements ServiceAdministrator { private ServiceRegistryExporter serviceRegistryExporter; @AstrixInject public void setServiceRegistryExporter(ServiceRegistryExporter serviceRegistryExporter) { this.serviceRegistryExporter = serviceRegistryExporter; } @Override public void setPublishServices(boolean published) { this.serviceRegistryExporter.setPublished(published); } }
@AstrixApiProvider public interface LunchServiceProvider { @AstrixConfigDiscovery("restaurantFinderUri") @Service LunchRestaurantFinder lunchRestaurantFinder(); }
@AstrixApplication( exportsRemoteServicesFor = { LunchServiceProvider.class }, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class LunchApplicationDescriptor { }
@AstrixApiProvider public class LunchLibraryProvider { @Library public LunchSuggester lunchSuggester(LunchRestaurantFinder restaurantFinder) { return new LunchSuggesterImpl(restaurantFinder); } }
@AstrixApplication( exportsRemoteServicesFor = TradingServiceApiProvider.class, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class TradingApplicationDescriptor { }
@AstrixApiProvider public class LunchLibraryProvider { @Library public LunchSuggester lunchUtil(LunchRestaurantFinder restaurantFinder) { return new LunchSuggesterImpl(restaurantFinder); } @Library public LunchRestaurantFinder lunchRestaurantFinder() { return new LunchRestaurantsFinderImpl(); } }
@AstrixApplication( exportsRemoteServicesFor = { LunchServiceProvider.class, LunchFeederApiDescriptor.class }, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class LunchApplicationDescriptor { }
@AstrixApiProvider public class AstrixServiceRegistryLibraryProvider implements AstrixConfigAware { private DynamicConfig config; @Library public ServiceRegistryClient createClient(AstrixServiceRegistry serviceRegistry) { return new ServiceRegistryClientFactory(config, () -> serviceRegistry).createServiceRegistryClient(); } @Override public void setConfig(DynamicConfig config) { this.config = config; } }
@AstrixApplication( exportsRemoteServicesFor = { LunchServiceProvider.class }, defaultServiceComponent = AstrixServiceComponentNames.GS_REMOTING ) public class LunchApplicationDescriptor { }
@AstrixApiProvider public interface TradingServiceApiProvider { @Service AccountService accountService(); }
@AstrixApiProvider public class LunchLibraryProvider { @Library public LunchUtil lunchUtil(LunchService lunchService) { return new LunchUtilImpl(lunchService); } @Library public LunchStatistics createLunchGraderUtil(@AstrixQualifier("lunch-space") GigaSpace lunchSpaceProxy) { return new LunchStatisticsImpl(lunchSpaceProxy); } }