Package org.xdoclet.plugin.ejb.qtags

Examples of org.xdoclet.plugin.ejb.qtags.EjbFinderTag


        Collection finderMethodsBySignature = CollectionUtils.select(Arrays.asList(javaClass.getTagsByName(
                    TagLibrary.EJB_FINDER, true)),
                new Predicate() {
                    public boolean evaluate(Object object) {
                        EjbFinderTag finderTag = (EjbFinderTag) object;
                        boolean retVal = finderTag.getResultTypeMapping() == null ||
                            finderTag.getResultTypeMapping().equals(EjbUtils.REMOTE_INTERFACE);
                        retVal = retVal && EjbUtils.hasFlag(ejbUtils.getViewType(finderTag.getViewType()), viewType);
                        return retVal;
                    }
                });

        finderMethods.addAll(CollectionUtils.collect(finderMethodsBySignature,
                new Transformer() {
                public Object transform(Object object) {
                    EjbFinderTag finderTag = (EjbFinderTag) object;
                    return ejbUtils.getFinderMethodBySignature(finderTag.getSignature());
                }
            }));

        // Add mandatory findByPrimaryKey if not already there
        // Is this only for CMP ?? (xdoclet-1.2.3 says so, but i'll ignore
View Full Code Here


        if (isEntityBean(javaClass)) {
            tags = javaClass.getTagsByName(TagLibrary.EJB_FINDER);

            // Let dig into class level ejb.finder tags
            for (int i = 0; i < tags.length; i++) {
                EjbFinderTag finderTag = (EjbFinderTag) tags[i];
                int permType = getViewType(finderTag.getViewType()) & (REMOTE_HOME | LOCAL_HOME);

                // -------------------------------------------------------
                // Let's "bitwise and" to get only the specied masks
                // that are compatible with the bean
                // HUMM: Is this valid ?
                if (finderTag.getMethodIntf() != null) {
                    permType &= getInterfaceType(finderTag.getMethodIntf());
                }

                if (permType == 0) {
                    throw getErrorWithTagLocation(finderTag,
                        "Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
                }

                // -------------------------------------------------------
                // We are generating an method permission if there is at least
                // one role or unchecked is true
                // NOTE: unchecked is only valid for EJB 2.0+
                boolean canContinue = (finderTag.getRoleNames() != null && finderTag.getRoleNames().length > 0);

                if (version.greaterOrEquals(EjbVersion.EJB_2_0)) {
                    canContinue |= finderTag.isUnchecked();
                }

                if (canContinue) {
                    // Lets expand by permission for interface type
                    // Method signature should maybe be unrolled by permType, but it's not really relevant
                    // the return type, soo..
                    retLst.addAll(MethodPermission.unroll(permType, getFinderMethodBySignature(finderTag.getSignature()),
                            finderTag.getRoleNames()));
                }
            }

            EjbPkTag pkTag = (EjbPkTag) javaClass.getTagByName(TagLibrary.EJB_PK);
View Full Code Here

        if (isEntityBean(javaClass)) {
            tags = javaClass.getTagsByName(TagLibrary.EJB_FINDER);

            // Let dig into class level ejb.finder tags
            for (int i = 0; i < tags.length; i++) {
                EjbFinderTag finderTag = (EjbFinderTag) tags[i];

                if (finderTag.getTransactionType() == null) {
                    // We are processing method transactions.
                    // So the optional element must be present
                    continue;
                }

                int permType = getViewType(finderTag.getViewType()) & (REMOTE_HOME | LOCAL_HOME);

                // -------------------------------------------------------
                // Let's "bitwise and" to get only the specied masks
                // that are compatible with the bean
                // HUMM: Is this valid ?
                if (finderTag.getMethodIntf() != null) {
                    permType &= getInterfaceType(finderTag.getMethodIntf());
                }

                if (permType == 0) {
                    throw getErrorWithTagLocation(finderTag,
                        "Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
                }

                // Lets expand by permission for interface type
                // Method signature should maybe be unrolled by permType, but it's not really relevant
                // the return type, soo..
                retLst.addAll(ContainerTransaction.unroll(permType,
                        getFinderMethodBySignature(finderTag.getSignature()), finderTag.getTransactionType()));
            }
        }

        return retLst;
    }
View Full Code Here

TOP

Related Classes of org.xdoclet.plugin.ejb.qtags.EjbFinderTag

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.