use of org.jboss.as.jsr77.ejb.ManagementHomeEjbComponentView in project wildfly by wildfly.
the class RegisterManagementEJBService method start.
@Override
public void start(StartContext context) throws StartException {
final DeploymentRepository repository = deploymentRepositoryValue.getValue();
moduleIdentifier = new DeploymentModuleIdentifier(APP_NAME, MODULE_NAME, DISTINCT_NAME);
final InjectedValue<ComponentView> injectedHomeView = new InjectedValue<ComponentView>();
injectedHomeView.setValue(new ImmediateValue<ComponentView>(new ManagementHomeEjbComponentView()));
final InjectedValue<ComponentView> injectedRemoteView = new InjectedValue<ComponentView>();
injectedRemoteView.setValue(new ImmediateValue<ComponentView>(new ManagementRemoteEjbComponentView(mbeanServerValue.getValue())));
Map<String, InjectedValue<ComponentView>> views = new HashMap<String, InjectedValue<ComponentView>>();
views.put(ManagementHome.class.getName(), injectedHomeView);
views.put(Management.class.getName(), injectedRemoteView);
final EjbDeploymentInformation ejb = new ManagementEjbDeploymentInformation(EJB_NAME, views, SecurityActions.getClassLoader(this.getClass()));
final ModuleDeployment deployment = new ModuleDeployment(moduleIdentifier, Collections.singletonMap(EJB_NAME, ejb));
repository.add(moduleIdentifier, deployment);
repository.startDeployment(moduleIdentifier);
doPrivileged((PrivilegedAction<Void>) () -> {
final ClassLoader classLoader = getClass().getClassLoader();
EJBClientContext.getContextManager().setClassLoaderDefault(classLoader, ejbClientContextValue.getValue().getClientContext());
Discovery.getContextManager().setClassLoaderDefault(classLoader, Discovery.create(associationServiceInjector.getValue().getLocalDiscoveryProvider()));
return null;
});
}
Aggregations