use of org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService in project wildfly by wildfly.
the class FederationDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
PicketLinkFederationService federationService = deploymentUnit.getAttachment(FederationDependencyProcessor.DEPLOYMENT_ATTACHMENT_KEY);
if (federationService != null) {
ROOT_LOGGER.federationConfiguringDeployment(deploymentUnit.getName());
federationService.configure(deploymentUnit);
}
}
use of org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService in project wildfly by wildfly.
the class AbstractPicketLinkMetricsOperationHandler method execute.
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
final String name = address.getLastElement().getValue();
final String attributeName = operation.require(NAME).asString();
final ServiceController<?> controller = context.getServiceRegistry(false).getRequiredService(createServiceName(name));
try {
PicketLinkFederationService<?> service = (PicketLinkFederationService<?>) controller.getValue();
doPopulateResult(service.getMetrics(), context.getResult(), attributeName);
} catch (Exception e) {
throw PicketLinkLogger.ROOT_LOGGER.failedToGetMetrics(e.getMessage());
}
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
}, OperationContext.Stage.RUNTIME);
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
Aggregations