use of org.jboss.as.pojo.descriptor.DefaultConfigVisitor in project wildfly by wildfly.
the class AbstractPojoPhase method startInternal.
protected void startInternal(StartContext context) throws StartException {
try {
executeInstalls();
// only after describe do we have a bean
if (getLifecycleState().isAfter(BeanState.DESCRIBED)) {
addCallbacks(true);
addCallbacks(false);
ServiceRegistry registry = context.getController().getServiceContainer();
InstancesService.addInstance(registry, context.getChildTarget(), getLifecycleState(), getBean());
}
// do we have a next phase
final AbstractPojoPhase nextPhase = createNextPhase();
if (nextPhase != null) {
final BeanState state = getLifecycleState();
final BeanState next = state.next();
final BeanMetaDataConfig beanConfig = getBeanConfig();
final ServiceName name = BeanMetaDataConfig.toBeanName(beanConfig.getName(), next);
final ServiceTarget serviceTarget = context.getChildTarget();
final ServiceBuilder serviceBuilder = serviceTarget.addService(name, nextPhase);
registerAliases(serviceBuilder, next);
final ConfigVisitor visitor = new DefaultConfigVisitor(serviceBuilder, state, getModule(), getIndex(), getBeanInfo());
beanConfig.visit(visitor);
nextPhase.setModule(getModule());
nextPhase.setBeanConfig(getBeanConfig());
nextPhase.setIndex(getIndex());
nextPhase.setBeanInfo(getBeanInfo());
nextPhase.setBean(getBean());
serviceBuilder.install();
}
} catch (Throwable t) {
throw new StartException(t);
}
}
use of org.jboss.as.pojo.descriptor.DefaultConfigVisitor in project wildfly by wildfly.
the class ParsedKernelDeploymentProcessor method describeBean.
protected void describeBean(final Module module, final ServiceTarget serviceTarget, DeploymentReflectionIndex deploymentIndex, BeanMetaDataConfig beanConfig) {
final BeanState state = BeanState.NOT_INSTALLED;
final ServiceName describedServiceName = BeanMetaDataConfig.toBeanName(beanConfig.getName(), state.next());
final DescribedPojoPhase describedService = new DescribedPojoPhase(deploymentIndex, beanConfig);
final ServiceBuilder describedServiceBuilder = serviceTarget.addService(describedServiceName, describedService);
describedService.registerAliases(describedServiceBuilder);
final ConfigVisitor visitor = new DefaultConfigVisitor(describedServiceBuilder, state, module, deploymentIndex);
beanConfig.visit(visitor);
describedServiceBuilder.setInitialMode(beanConfig.getMode().getMode());
describedServiceBuilder.install();
}
Aggregations