use of org.jboss.as.ejb3.component.singleton.SingletonComponent in project wildfly by wildfly.
the class SingletonComponent method instantiateComponentInstance.
@Override
protected BasicComponentInstance instantiateComponentInstance(Interceptor preDestroyInterceptor, Map<Method, Interceptor> methodInterceptors, Map<Object, Object> context) {
// synchronized from getComponentInstance
assert Thread.holdsLock(creationLock);
if (dependsOn != null) {
for (ServiceName serviceName : dependsOn) {
final ServiceController<Component> service = (ServiceController<Component>) currentServiceContainer().getRequiredService(serviceName);
final Component component = service.getValue();
if (component instanceof SingletonComponent) {
((SingletonComponent) component).getComponentInstance();
}
}
}
return new SingletonComponentInstance(this, preDestroyInterceptor, methodInterceptors);
}
use of org.jboss.as.ejb3.component.singleton.SingletonComponent in project wildfly by wildfly.
the class NonFunctionalTimerService method assertInvocationAllowed.
private void assertInvocationAllowed() {
AllowedMethodsInformation.checkAllowed(MethodType.TIMER_SERVICE_METHOD);
final InterceptorContext currentInvocationContext = CurrentInvocationContext.get();
if (currentInvocationContext == null) {
return;
}
// If the method in current invocation context is null,
// then it represents a lifecycle callback invocation
Method invokedMethod = currentInvocationContext.getMethod();
if (invokedMethod == null) {
// it's a lifecycle callback
Component component = currentInvocationContext.getPrivateData(Component.class);
if (!(component instanceof SingletonComponent)) {
throw EjbLogger.EJB3_TIMER_LOGGER.failToInvokeTimerServiceDoLifecycle();
}
}
}
Aggregations