Package org.gatein.management.api.operation

Examples of org.gatein.management.api.operation.OperationContextDelegate


        if (handler != null && !root && address.accepts(filter)) {
            handler.execute(operationContext, stepResultHandler);
        } else {
            OperationHandler readResource = resource.getOperationHandler(address, OperationNames.READ_RESOURCE);
            BasicResultHandler readResourceResult = new BasicResultHandler();
            readResource.execute(new OperationContextDelegate(operationContext) {
                @Override
                public String getOperationName() {
                    return OperationNames.READ_RESOURCE;
                }
            }, readResourceResult);
            if (readResourceResult.getFailureDescription() != null) {
                throw new OperationException(operationName, "Failure '" + readResourceResult.getFailureDescription()
                        + "' encountered executing " + OperationNames.READ_RESOURCE);
            }

            Object model = readResourceResult.getResult();
            if (!(model instanceof ReadResourceModel)) {
                throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation "
                        + OperationNames.READ_RESOURCE + " at address " + address);
            }

            for (String child : ((ReadResourceModel) model).getChildren()) {
                final PathAddress childAddress = address.append(child);
                OperationContext childContext = new OperationContextDelegate(operationContext) {
                    @Override
                    public PathAddress getAddress() {
                        return childAddress;
                    }
                };
View Full Code Here


        if (handler != null && !root && address.accepts(filter)) {
            handler.execute(operationContext, stepResultHandler);
        } else {
            OperationHandler readResource = resource.getOperationHandler(address, OperationNames.READ_RESOURCE);
            BasicResultHandler readResourceResult = new BasicResultHandler();
            readResource.execute(new OperationContextDelegate(operationContext) {
                @Override
                public String getOperationName() {
                    return OperationNames.READ_RESOURCE;
                }
            }, readResourceResult);
            if (readResourceResult.getFailureDescription() != null) {
                throw new OperationException(operationName, "Failure '" + readResourceResult.getFailureDescription()
                        + "' encountered executing " + OperationNames.READ_RESOURCE);
            }

            Object model = readResourceResult.getResult();
            if (!(model instanceof ReadResourceModel)) {
                throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation "
                        + OperationNames.READ_RESOURCE + " at address " + address);
            }

            for (String child : ((ReadResourceModel) model).getChildren()) {
                final PathAddress childAddress = address.append(child);
                OperationContext childContext = new OperationContextDelegate(operationContext) {
                    @Override
                    public PathAddress getAddress() {
                        return childAddress;
                    }
                };
View Full Code Here

      }
      else
      {
         OperationHandler readResource = resource.getOperationHandler(address, OperationNames.READ_RESOURCE);
         BasicResultHandler readResourceResult = new BasicResultHandler();
         readResource.execute(new OperationContextDelegate(operationContext)
         {
            @Override
            public String getOperationName()
            {
               return OperationNames.READ_RESOURCE;
            }
         }, readResourceResult);
         if (readResourceResult.getFailureDescription() != null)
         {
            throw new OperationException(operationName, "Failure '" + readResourceResult.getFailureDescription() + "' encountered executing " + OperationNames.READ_RESOURCE);
         }

         Object model = readResourceResult.getResult();
         if (! (model instanceof ReadResourceModel) )
         {
            throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation " + OperationNames.READ_RESOURCE + " at address " + address);
         }

         for (String child : ((ReadResourceModel) model).getChildren())
         {
            final PathAddress childAddress = address.append(child);
            OperationContext childContext = new OperationContextDelegate(operationContext)
            {
               @Override
               public PathAddress getAddress()
               {
                  return childAddress;
View Full Code Here

         }

         for (String child : ((ReadResourceModel) model).getChildren())
         {
            final PathAddress childAddress = address.append(child);
            OperationContext childContext = new OperationContextDelegate(operationContext)
            {
               @Override
               public PathAddress getAddress()
               {
                  return childAddress;
View Full Code Here

TOP

Related Classes of org.gatein.management.api.operation.OperationContextDelegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.