コード例 #1
0
  @Override
  public void extend(ApplicationExtensionContext context) throws Exception {

    String appId = context.application().id();

    ServiceTarget target = context.target();

    DroolsPolicy policy = new DroolsPolicy();
    target
        .addService(
            DroolsPolicyServices.policy(appId, context.resourceId()),
            new ValueService<>(new ImmediateValue<>(policy)))
        .install();

    DroolsPolicyResourceService resource = new DroolsPolicyResourceService(context.resourceId());

    target
        .addService(Services.resource(appId, context.resourceId()), resource)
        .addDependency(
            DroolsPolicyServices.policy(appId, context.resourceId()),
            DroolsPolicy.class,
            resource.policyInjector())
        .install();

    DroolsPolicyConfigResourceService configResource =
        new DroolsPolicyConfigResourceService(context.resourceId());
    target
        .addService(Services.adminResource(appId, context.resourceId()), configResource)
        .addDependency(
            DroolsPolicyServices.policy(appId, context.resourceId()),
            DroolsPolicy.class,
            configResource.policyInjector())
        .install();

    context.mountPublic();
    context.mountPrivate();
  }
コード例 #2
0
ファイル: LiveOakSystem.java プロジェクト: vrockai/liveoak
 public Server localServer(String name) throws InterruptedException {
   return (Server) this.serviceContainer.getService(Services.server(name, false)).awaitValue();
 }
コード例 #3
0
ファイル: LiveOakSystem.java プロジェクト: vrockai/liveoak
 public Server networkServer(String name) throws InterruptedException {
   return (Server) this.serviceContainer.getService(Services.server(name, true)).awaitValue();
 }