Examples of Locktype


Examples of javax.ejb.LockType

    }

    @Override
    public LockType getLockType(Method method) {
        EJBBusinessMethod beanMethod = new EJBBusinessMethod(method.getName(), method.getParameterTypes());
        LockType lockType = this.methodLockTypes.get(beanMethod);
        if (lockType != null) {
            return lockType;
        }
        // check bean level lock type
        if (this.beanLevelLockType != null) {
View Full Code Here

Examples of javax.ejb.LockType

                }
            }
        }

        // bean level lock type
        LockType overrideBeanLockType = override.getBeanLevelLockType();
        if (overrideBeanLockType != null) {
            mergedBean.setBeanLevelLockType(overrideBeanLockType);
        } else {
            LockType originalBeanLockType = original.getBeanLevelLockType();
            if (originalBeanLockType != null) {
                mergedBean.setBeanLevelLockType(originalBeanLockType);
            }
        }
View Full Code Here

Examples of javax.ejb.LockType

            return;
        }

        for (AnnotationInstance annotationInstance : annotations) {
            AnnotationTarget target = annotationInstance.target();
            LockType lockType = LockType.valueOf(annotationInstance.value().asEnum());
            if (target instanceof ClassInfo) {
                // bean level
                componentDescription.setBeanLevelLockType(lockType);
                logger.debug("Bean " + componentDescription.getEJBName() + " marked for lock type " + lockType);
            } else if (target instanceof MethodInfo) {
View Full Code Here

Examples of javax.ejb.LockType

        Boolean initOnStartup = singletonBeanMetaData.isInitOnStartup();
        if (initOnStartup != null && initOnStartup.booleanValue() == true) {
            singletonComponentDescription.initOnStartup();
        }
        // bean level lock-type
        LockType lockType = singletonBeanMetaData.getLockType();
        singletonComponentDescription.setBeanLevelLockType(lockType);
        // add method level lock type to the description
        ConcurrentMethodsMetaData concurrentMethods = singletonBeanMetaData.getConcurrentMethods();
        if (concurrentMethods != null) {
            for (ConcurrentMethodMetaData concurrentMethod : concurrentMethods) {
                LockType methodLockType = concurrentMethod.getLockType();
                EJBMethodDescription method = this.getEJBMethodDescription(concurrentMethod.getMethod());
                singletonComponentDescription.setLockType(methodLockType, method);
            }
        }
View Full Code Here

Examples of javax.ejb.LockType

    }

    @Override
    public LockType getLockType(Method method) {
        final EJBBusinessMethod ejbMethod = new EJBBusinessMethod(method);
        final LockType lockType = this.methodLockTypes.get(ejbMethod);
        if (lockType != null) {
            return lockType;
        }
        // check bean level lock type
        final LockType type = this.beanLevelLockType.get(method.getDeclaringClass().getName());
        if (type != null) {
            return type;
        }
        // default WRITE lock type
        return LockType.WRITE;
View Full Code Here

Examples of javax.ejb.LockType

                }
            }
        }

        // bean level lock type
        LockType overrideBeanLockType = override.getBeanLevelLockType().get(mergedBean.getEJBClassName());
        if (overrideBeanLockType != null) {
            mergedBean.setBeanLevelLockType(mergedBean.getEJBClassName(), overrideBeanLockType);
        } else {
            LockType originalBeanLockType = original.getBeanLevelLockType().get(mergedBean.getEJBClassName());
            if (originalBeanLockType != null) {
                mergedBean.setBeanLevelLockType(mergedBean.getEJBClassName(), originalBeanLockType);
            }
        }
View Full Code Here

Examples of lineage2.gameserver.model.items.LockType

   * @param show boolean
   */
  public void sendItemList(boolean show)
  {
    ItemInstance[] items = getInventory().getItems();
    LockType lockType = getInventory().getLockType();
    int[] lockItems = getInventory().getLockItems();
    int allSize = items.length;
    int questItemsSize = 0;
    int agathionItemsSize = 0;
    for (ItemInstance item : items)
View Full Code Here

Examples of net.opengis.wfs.LockType

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        LockType lock = wfsfactory.createLockType();

        //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"/>
        if (node.hasChild(Filter.class)) {
            lock.setFilter((Filter) node.getChildValue(Filter.class));
        }

        //<xsd:attribute name="handle" type="xsd:string" use="optional">
        if (node.hasAttribute("handle")) {
            lock.setHandle((String) node.getAttributeValue("handle"));
        }

        //<xsd:attribute name="typeName" type="xsd:QName" use="required">
        lock.setTypeName((QName) node.getAttributeValue("typeName"));

        return lock;
    }
View Full Code Here

Examples of net.opengis.wfs.LockType

            // by feature basis
            // in order to allow for both "all" and "some" lock behaviour
            // TODO: if the lock is the default this default, lock the whole
            // query directly, should be a lot faster
            for (int i = 0, n = locks.size(); i < n; i++) {
                LockType lock = (LockType) locks.get(i);
                LOGGER.info("curLock is " + lock);

                QName typeName = lock.getTypeName();

                // get out the filter, and default to no filtering if none was
                // provided
                Filter filter = (Filter) lock.getFilter();

                if (filter == null) {
                    filter = Filter.INCLUDE;
                }

                FeatureTypeInfo meta;
                FeatureSource<? extends FeatureType, ? extends Feature> source;
                FeatureCollection<? extends FeatureType, ? extends Feature> features;

                try {
                    meta = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());

                    if (meta == null) {
                        throw new WFSException("Unknown feature type " + typeName.getPrefix() + ":"
                            + typeName.getLocalPart());
                    }

                    source = meta.getFeatureSource(null,null);
                   
                    // make sure all geometric elements in the filter have a crs, and that the filter
                    // is reprojected to store's native crs as well
                    CoordinateReferenceSystem declaredCRS = WFSReprojectionUtil.getDeclaredCrs(
                            source.getSchema(), request.getVersion());
                    filter = WFSReprojectionUtil.normalizeFilterCRS(filter, source.getSchema(), declaredCRS);
                   
                    // now gather the features
                    features = source.getFeatures(filter);

                    if (source instanceof FeatureLocking) {
                        ((FeatureLocking<SimpleFeatureType, SimpleFeature>) source).setFeatureLock(fLock);
                    }
                } catch (IOException e) {
                    throw new WFSException(e);
                }

                Iterator reader = null;
                int numberLocked = -1;

                try {
                    for (reader = features.iterator(); reader.hasNext();) {
                        SimpleFeature feature = (SimpleFeature) reader.next();

                        FeatureId fid = fid(feature.getID());
                        Id fidFilter = fidFilter(fid);

                        if (!(source instanceof FeatureLocking)) {
                            LOGGER.fine("Lock " + fid + " not supported by data store (authID:"
                                + fLock.getAuthorization() + ")");

                            response.getFeaturesNotLocked().getFeatureId().add(fid);

                            // lockFailedFids.add(fid);
                        } else {
                            // DEFQuery is just some indirection, should be in
                            // the locking interface.
                            // int numberLocked =
                            // ((DEFQueryFeatureLocking)source).lockFeature(feature);
                            // HACK: Query.NO_NAMES isn't working in postgis
                            // right now,
                            // so we'll just use all.
                            Query query = new DefaultQuery(meta.getName(), (Filter) fidFilter,
                                    Query.DEFAULT_MAX, Query.ALL_NAMES, lock.getHandle());

                            numberLocked = ((FeatureLocking<SimpleFeatureType, SimpleFeature>) source)
                                    .lockFeatures(query);

                            if (numberLocked == 1) {
View Full Code Here

Examples of net.opengis.wfs.LockType

            lockRequest.setLockAction(AllSomeType.ALL_LITERAL);

            for (int i = 0; i < request.getQuery().size(); i++) {
                QueryType query = (QueryType) request.getQuery().get(i);

                LockType lock = WfsFactory.eINSTANCE.createLockType();
                lock.setFilter(query.getFilter());
                lock.setHandle(query.getHandle());

                //TODO: joins?
                lock.setTypeName((QName) query.getTypeName().get(0));
                lockRequest.getLock().add(lock);
            }

            LockFeature lockFeature = new LockFeature(wfs, catalog);
            lockFeature.setFilterFactory(filterFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.