Package org.jboss.as.ejb3.component

Examples of org.jboss.as.ejb3.component.MethodIntf


                final ExcludeListMetaData excludeList = assemblyDescriptor.getExcludeListByEjbName(componentConfiguration.getEJBName());
                if (excludeList != null && excludeList.getMethods() != null) {
                    for (final MethodMetaData method : excludeList.getMethods()) {
                        final String methodName = method.getMethodName();
                        final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
                        if (methodName.equals("*")) {
                            componentConfiguration.getMethodPermissions().setAttribute(methodIntf, null, EJBMethodSecurityAttribute.denyAll());
                        } else {

                            final MethodParametersMetaData methodParams = method.getMethodParams();
                            // update the session bean description with the tx attribute info
                            if (methodParams == null) {
                                componentConfiguration.getMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), methodName);
                            } else {

                                componentConfiguration.getMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), null, methodName, this.getMethodParams(methodParams));
                            }
                        }
                    }
                }

                //now handle method permissions
                final MethodPermissionsMetaData methodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName(componentConfiguration.getEJBName());
                if (methodPermissions != null) {
                    for (final MethodPermissionMetaData methodPermissionMetaData : methodPermissions) {

                        final MethodsMetaData methods = methodPermissionMetaData.getMethods();
                        for (final MethodMetaData method : methods) {
                            EJBMethodSecurityAttribute ejbMethodSecurityMetaData;
                            // EJB 3.1 FR 17.3.2.2 The unchecked element is used instead of a role name in the method-permission element to indicate that all roles are permitted.
                            if (methodPermissionMetaData.isNotChecked()) {
                                ejbMethodSecurityMetaData = EJBMethodSecurityAttribute.permitAll();
                            } else {
                                ejbMethodSecurityMetaData = EJBMethodSecurityAttribute.rolesAllowed(methodPermissionMetaData.getRoles());
                            }
                            final String methodName = method.getMethodName();
                            final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
                            if (methodName.equals("*")) {
                                final EJBMethodSecurityAttribute existingRoles = componentConfiguration.getMethodPermissions().getAttributeStyle1(methodIntf, null);
                                ejbMethodSecurityMetaData = mergeExistingRoles(ejbMethodSecurityMetaData, existingRoles);
                                componentConfiguration.getMethodPermissions().setAttribute(methodIntf, null, ejbMethodSecurityMetaData);
                            } else {
View Full Code Here


            // Initialize beanPOA and create metadata depending on the kind of bean
            if (component instanceof EntityBeanComponent) {

                // This is an entity bean (lifespan: persistent)
                beanServantRegistry = poaRegistry.getValue().getRegistryWithPersistentPOAPerServant();
                final EntityBeanComponent entityBeanComponent = (EntityBeanComponent) component;
                final Class pkClass = entityBeanComponent.getPrimaryKeyClass();
                ejbMetaData = new EJBMetaDataImplIIOP(entityBeanComponent.getRemoteClass(), entityBeanComponent.getHomeClass(), pkClass, false, false, homeHandle);
            } else {
                // This is a session bean (lifespan: transient)
                beanServantRegistry = poaRegistry.getValue().getRegistryWithTransientPOAPerServant();
                if (component instanceof StatelessSessionComponent) {
                    // Stateless session bean
View Full Code Here

            } else if (method.getName().equals("remove") && method.getParameterTypes().length == 0) {
                handleRemoveMethod(componentConfiguration, configuration, index, method);

            } else if (method.getName().equals("getEJBLocalHome") && method.getParameterTypes().length == 0) {
                configuration.addClientInterceptor(method, ViewDescription.CLIENT_DISPATCHER_INTERCEPTOR_FACTORY, InterceptorOrder.Client.CLIENT_DISPATCHER);
                final GetHomeInterceptorFactory factory = new GetHomeInterceptorFactory();
                configuration.addViewInterceptor(method, factory, InterceptorOrder.View.COMPONENT_DISPATCHER);
                final SessionBeanComponentDescription componentDescription = (SessionBeanComponentDescription) componentConfiguration.getComponentDescription();
                componentConfiguration.getStartDependencies().add(new DependencyConfigurator<ComponentStartService>() {
                    @Override
                    public void configureDependency(final ServiceBuilder<?> serviceBuilder, final ComponentStartService service) throws DeploymentUnitProcessingException {
                        serviceBuilder.addDependency(componentDescription.getEjbLocalHomeView().getServiceName(), ComponentView.class, factory.getViewToCreate());
                    }
                });
            } else if (method.getName().equals("getEJBHome") && method.getParameterTypes().length == 0) {
                configuration.addClientInterceptor(method, ViewDescription.CLIENT_DISPATCHER_INTERCEPTOR_FACTORY, InterceptorOrder.Client.CLIENT_DISPATCHER);
                final GetHomeInterceptorFactory factory = new GetHomeInterceptorFactory();
                configuration.addViewInterceptor(method, factory, InterceptorOrder.View.COMPONENT_DISPATCHER);
                final SessionBeanComponentDescription componentDescription = (SessionBeanComponentDescription) componentConfiguration.getComponentDescription();
                componentConfiguration.getStartDependencies().add(new DependencyConfigurator<ComponentStartService>() {
                    @Override
                    public void configureDependency(final ServiceBuilder<?> serviceBuilder, final ComponentStartService service) throws DeploymentUnitProcessingException {
                        serviceBuilder.addDependency(componentDescription.getEjbHomeView().getServiceName(), ComponentView.class, factory.getViewToCreate());
                    }
                });
            } else if (method.getName().equals("getHandle") && method.getParameterTypes().length == 0) {
                //ignore, handled client side
            } else if (method.getName().equals("isIdentical") && method.getParameterTypes().length == 1 && (method.getParameterTypes()[0].equals(EJBObject.class) || method.getParameterTypes()[0].equals(EJBLocalObject.class))) {
View Full Code Here

            } else {
                beanClassName = beanClassInfo.name().toString();
                messageListenerInterfaceName = getMessageListenerInterface(compositeIndex, messageBeanAnnotation);
            }
            final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry());
            final MessageDrivenComponentDescription beanDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnitServiceName, messageListenerInterfaceName, activationConfigProperties, defaultResourceAdapterName, beanMetaData);
            beanDescription.setDeploymentDescriptorEnvironment(deploymentDescriptorEnvironment);

            addComponent(deploymentUnit, beanDescription);
        }

        EjbDeploymentMarker.mark(deploymentUnit);
View Full Code Here

            // TODO: This isn't really correct to default to MessageListener
            messageListenerInterface = MessageListener.class.getName();
        }
        final Properties activationConfigProps = getActivationConfigProperties(mdb.getActivationConfig());
        final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry());
        final MessageDrivenComponentDescription mdbComponentDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), messageListenerInterface, activationConfigProps, defaultResourceAdapterName, mdb);
        mdbComponentDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", mdb));
        addComponent(deploymentUnit, mdbComponentDescription);
    }
View Full Code Here

    private final boolean stateful;
    private final boolean singleton;
    private final boolean messageDriven;

    public EjbDescriptorImpl(EJBComponentDescription componentDescription, BeanDeploymentArchiveImpl beanDeploymentArchive, final DeploymentReflectionIndex reflectionIndex) {
        final SessionBeanComponentDescription description = componentDescription instanceof SessionBeanComponentDescription ? (SessionBeanComponentDescription) componentDescription : null;
        final Set<BusinessInterfaceDescriptor<?>> localInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        final Set<BusinessInterfaceDescriptor<?>> remoteInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        final ResourceLoader loader = beanDeploymentArchive.getServices().get(ResourceLoader.class);

        ejbClass = (Class<T>) loader.classForName(componentDescription.getEJBClassName());
View Full Code Here

        }
    }

    private static EJBEndpoint newEjbEndpoint(final PortComponentMetaData portComponentMD, final EEModuleDescription moduleDescription, final Set<String> securityRoles) {
        final String ejbName = portComponentMD.getEjbLink();
        final SessionBeanComponentDescription sessionBean = (SessionBeanComponentDescription)moduleDescription.getComponentByName(ejbName);
        final String seiIfaceClassName = portComponentMD.getServiceEndpointInterface();
        final EJBViewDescription ejbViewDescription = sessionBean.addWebserviceEndpointView(seiIfaceClassName);
        // JSR 109 - Version 1.3 - 6.2.2.4 Security
        // For EJB based service implementations, Handlers run after method level authorization has occurred.
        // JSR 109 - Version 1.3 - 6.2.2.5 Transaction
        // Handlers run under the transaction context of the component they are associated with.
        sessionBean.getConfigurators().addLast(new JAXRPCHandlersConfigurator());
        final ServiceName ejbViewName = ejbViewDescription.getServiceName();

        return new EJBEndpoint(sessionBean, ejbViewName, securityRoles, null, false, null);
    }
View Full Code Here

            } else {
                beanClassName = sessionBeanClassInfo.name().toString();
                sessionBeanType = annotatedSessionBeanType;
            }

            final SessionBeanComponentDescription sessionBeanDescription;
            switch (sessionBeanType) {
                case STATELESS:
                    sessionBeanDescription = new StatelessComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnitServiceName, beanMetaData);
                    break;
                case STATEFUL:
View Full Code Here

                throw EjbMessages.MESSAGES.sessionTypeNotSpecified(beanName);
            }
        }

        final String beanClassName = sessionBean.getEjbClass();
        final SessionBeanComponentDescription sessionBeanDescription;
        switch (sessionType) {
            case Stateless:
                sessionBeanDescription = new StatelessComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), sessionBean);
                break;
            case Stateful:
View Full Code Here

                    break;
                case STATEFUL:
                    sessionBeanDescription = new StatefulComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnitServiceName, beanMetaData);
                    break;
                case SINGLETON:
                    sessionBeanDescription = new SingletonComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnitServiceName, beanMetaData);
                    break;
                default:
                    throw EjbMessages.MESSAGES.unknownSessionBeanType(sessionBeanType.name());
            }
View Full Code Here

TOP

Related Classes of org.jboss.as.ejb3.component.MethodIntf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.