@Override protected void setupViewInterceptors(EJBViewDescription view) { // let the super do its job super.setupViewInterceptors(view); view.getConfigurators().add(new ViewConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentConfiguration componentConfiguration, ViewDescription description, ViewConfiguration configuration) throws DeploymentUnitProcessingException { //add the invocation type to the start of the chain //TODO: is there a cleaner way to do this? configuration.addViewInterceptor(new ImmediateInterceptorFactory(new Interceptor() { @Override public Object processInvocation(final InterceptorContext context) throws Exception { context.putPrivateData(InvocationType.class, InvocationType.MESSAGE_DELIVERY); return context.proceed(); } }), InterceptorOrder.View.INVOCATION_TYPE); // add the instance associating interceptor at the start of the interceptor chain configuration.addViewInterceptor(MessageDrivenComponentInstanceAssociatingFactory.instance(), InterceptorOrder.View.ASSOCIATING_INTERCEPTOR); final MessageDrivenComponentDescription mdb = (MessageDrivenComponentDescription) componentConfiguration.getComponentDescription(); if (mdb.getTransactionManagementType() == TransactionManagementType.CONTAINER) { configuration.addViewInterceptor(CMTTxInterceptor.FACTORY, InterceptorOrder.View.CMT_TRANSACTION_INTERCEPTOR); } } }); }
@Override protected void setupViewInterceptors(EJBViewDescription view) { // let super do it's job first super.setupViewInterceptors(view); // tx management interceptor(s) addTxManagementInterceptorForView(view); if(view.isEjb2xView()) { view.getConfigurators().add(getSessionBeanObjectViewConfigurator()); } }
public void addLocalHome(final String localHome) { final EjbHomeViewDescription view = new EjbHomeViewDescription(this, localHome, MethodIntf.LOCAL_HOME); view.getConfigurators().add(new Ejb2ViewTypeConfigurator(Ejb2xViewType.LOCAL_HOME)); getViews().add(view); // setup server side view interceptors setupViewInterceptors(view); // setup client side view interceptors setupClientViewInterceptors(view); // return created view this.ejbLocalHomeView = view; }
protected EJBViewDescription registerView(final String viewClassName, final MethodIntf viewType, final boolean ejb2xView) { // setup the ViewDescription final EJBViewDescription viewDescription = new EJBViewDescription(this, viewClassName, viewType, ejb2xView); getViews().add(viewDescription); // setup server side view interceptors setupViewInterceptors(viewDescription); // setup client side view interceptors setupClientViewInterceptors(viewDescription); // return created view if (viewType == MethodIntf.REMOTE || viewType == MethodIntf.HOME) { setupRemoteView(viewDescription); } return viewDescription; }
public void addRemoteHome(final String remoteHome) { final EjbHomeViewDescription view = new EjbHomeViewDescription(this, remoteHome, MethodIntf.HOME); view.getConfigurators().add(new Ejb2ViewTypeConfigurator(Ejb2xViewType.HOME)); getViews().add(view); // setup server side view interceptors setupViewInterceptors(view); // setup client side view interceptors setupClientViewInterceptors(view); // return created view this.ejbHomeView = view; }
@Override protected void setupViewInterceptors(EJBViewDescription view) { // let the super do its job super.setupViewInterceptors(view); view.getConfigurators().add(new ViewConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentConfiguration componentConfiguration, ViewDescription description, ViewConfiguration configuration) throws DeploymentUnitProcessingException { //add the invocation type to the start of the chain //TODO: is there a cleaner way to do this? configuration.addViewInterceptor(new ImmediateInterceptorFactory(new Interceptor() { @Override public Object processInvocation(final InterceptorContext context) throws Exception { context.putPrivateData(InvocationType.class, InvocationType.MESSAGE_DELIVERY); return context.proceed(); } }), InterceptorOrder.View.INVOCATION_TYPE); // add the instance associating interceptor at the start of the interceptor chain configuration.addViewInterceptor(MessageDrivenComponentInstanceAssociatingFactory.instance(), InterceptorOrder.View.ASSOCIATING_INTERCEPTOR); final MessageDrivenComponentDescription mdb = (MessageDrivenComponentDescription) componentConfiguration.getComponentDescription(); if (mdb.getTransactionManagementType() == TransactionManagementType.CONTAINER) { configuration.addViewInterceptor(CMTTxInterceptor.FACTORY, InterceptorOrder.View.CMT_TRANSACTION_INTERCEPTOR); } } }); }
@Override protected void setupViewInterceptors(EJBViewDescription view) { // let super do it's job first super.setupViewInterceptors(view); // tx management interceptor(s) addTxManagementInterceptorForView(view); if(view.isEjb2xView()) { view.getConfigurators().add(getSessionBeanObjectViewConfigurator()); } }
public void addLocalHome(final String localHome) { final EjbHomeViewDescription view = new EjbHomeViewDescription(this, localHome, MethodIntf.LOCAL_HOME); view.getConfigurators().add(new Ejb2ViewTypeConfigurator(Ejb2xViewType.LOCAL_HOME)); getViews().add(view); // setup server side view interceptors setupViewInterceptors(view); // setup client side view interceptors setupClientViewInterceptors(view); // return created view this.ejbLocalHomeView = view; }
public void addRemoteHome(final String remoteHome) { final EjbHomeViewDescription view = new EjbHomeViewDescription(this, remoteHome, MethodIntf.HOME); view.getConfigurators().add(new Ejb2ViewTypeConfigurator(Ejb2xViewType.HOME)); getViews().add(view); // setup server side view interceptors setupViewInterceptors(view); // setup client side view interceptors setupClientViewInterceptors(view); // return created view this.ejbHomeView = view; }
protected EJBViewDescription registerView(final String viewClassName, final MethodIntf viewType, final boolean ejb2xView) { // setup the ViewDescription final EJBViewDescription viewDescription = new EJBViewDescription(this, viewClassName, viewType, ejb2xView); getViews().add(viewDescription); // setup server side view interceptors setupViewInterceptors(viewDescription); // setup client side view interceptors setupClientViewInterceptors(viewDescription); // return created view if (viewType == MethodIntf.REMOTE || viewType == MethodIntf.HOME) { setupRemoteView(viewDescription); } return viewDescription; }
@Override protected void setupViewInterceptors(EJBViewDescription view) { super.setupViewInterceptors(view);