Examples of EntityContainer


Examples of org.jboss.ejb.EntityContainer

      }

      // get the parameter order
      setParameterList(compiler.getInputParameters());

      EntityContainer con = ((JDBCStoreManager)compiler.getStoreManager()).getContainer();
      factory = metadata.isResultTypeMappingLocal() && con.getLocalHomeClass() != null ?
         con.getLocalProxyFactory() : con.getProxyFactory();
     
      return execute(
         compiler.getSQL(),
         parameters,
         offset,
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

         log.debug("Remove: Rows affected = " + rowsAffected);
   }

   public void invokeRemoveRelated(Object relatedId) throws RemoveException, RemoteException
   {
      EntityContainer container = relatedManager.getContainer();

      /*
      try
      {
         EntityCache instanceCache = (EntityCache) container.getInstanceCache();
         SecurityActions actions = SecurityActions.UTIL.getSecurityActions();

         org.jboss.invocation.Invocation invocation = new org.jboss.invocation.Invocation();
         invocation.setId(instanceCache.createCacheKey(relatedId));
         invocation.setArguments(new Object[]{});
         invocation.setTransaction(container.getTransactionManager().getTransaction());
         invocation.setPrincipal(actions.getPrincipal());
         invocation.setCredential(actions.getCredential());
         invocation.setType(invocationType);
         invocation.setMethod(removeMethod);

         container.invoke(invocation);
      }
      catch(EJBException e)
      {
         throw e;
      }
      catch(Exception e)
      {
         throw new EJBException("Error in remove instance", e);
      }
      */

      /**
       * Have to remove through EJB[Local}Object interface since the proxy contains the 'removed' flag
       * to be set on removal.
       */
      if(container.getLocalProxyFactory() != null)
      {
         final EJBLocalObject ejbObject = container.getLocalProxyFactory().getEntityEJBLocalObject(relatedId);
         ejbObject.remove();
      }
      else
      {
         final EJBObject ejbObject = (EJBObject)container.getProxyFactory().getEntityEJBObject(relatedId);
         ejbObject.remove();
      }
   }
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

 
   public Object invokeHome(Invocation mi)
      throws Exception
   {
      // Get context
      EntityContainer ec = (EntityContainer) getContainer();
      EntityEnterpriseContext ctx = (EntityEnterpriseContext) ec.getInstancePool().get();

    // Pass it to the method invocation
      mi.setEnterpriseContext(ctx);

      // Give it the transaction
      ctx.setTransaction(mi.getTransaction());

      // Set the current security information
      ctx.setPrincipal(mi.getPrincipal());

      AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_HOME);

      Object result;
      try
      {
         // Invoke through interceptors
         result = getNext().invokeHome(mi);
      }
      finally
      {
         AllowedOperationsAssociation.popInMethodFlag();
      }
     
      // No id, means we can put the context back in the pool
      if (ctx.getId() == null)
      {
         ctx.setTransaction(null);
         ec.getInstancePool().free(ctx);
      }
     
      // We are done
      return result;
   }
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

      // The key
      Object key = mi.getId();

      EntityEnterpriseContext ctx = null;
      EntityContainer ec = (EntityContainer) container;
      if (mi.getTransaction() != null)
      {
         //ctx = ec.getTxEntityMap().getCtx(mi.getTransaction(), key);
      }
      if (ctx == null)
      {
         InstancePool pool = ec.getInstancePool();
         try
         {
            ctx = (EntityEnterpriseContext) pool.get();
         }
         catch (EJBException e)
         {
            throw e;
         }
         catch (RemoteException e)
         {
            throw e;
         }
         catch (Exception e)
         {
            InvocationType type = mi.getType();
            boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME);
            if (isLocal)
               throw new EJBException("Unable to get an instance from the pool", e);
            else
               throw new RemoteException("Unable to get an intance from the pool", e);
         }
         ctx.setCacheKey(key);
         ctx.setId(key);
         EntityPersistenceManager pm = ec.getPersistenceManager();
         pm.activateEntity(ctx);
      }

      boolean trace = log.isTraceEnabled();
      if( trace ) log.trace("Begin invoke, key="+key);
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

   {
      boolean trace = log.isTraceEnabled();
      if(trace)
         log.trace("register, ctx=" + ctx + ", tx=" + tx);

      EntityContainer ctxContainer = null;
      try
      {
         ctxContainer = (EntityContainer)ctx.getContainer();
         if(!ctx.hasTxSynchronization())
         {
            // Create a new synchronization
            Synchronization synch = createSynchronization(tx, ctx);

            // We want to be notified when the transaction commits
            tx.registerSynchronization(synch);

            ctx.hasTxSynchronization(true);
         }
         //mark it dirty in global tx entity map if it is not read only
         if(!ctxContainer.isReadOnly())
         {
            ctx.getTxAssociation().scheduleSync(tx, ctx);
         }
      }
      catch(RollbackException e)
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

   private final Map selectorMap;

   public InstanceFactory(JDBCStoreManager2 manager, JDBCEntityBridge2 entity)
      throws Exception
   {
      EntityContainer theContainer = manager.getContainer();
      beanClass = theContainer.getBeanClass();
      fieldMap = createFieldMap(entity);
      selectorMap = createSelectorMap(entity, manager.getQueryFactory());
      // use proxy generator to create one implementation
      EntityBridgeInvocationHandler handler = new EntityBridgeInvocationHandler(fieldMap, selectorMap, beanClass);
      Class[] classes = new Class[]{beanClass};
View Full Code Here

Examples of org.jboss.ejb.EntityContainer

   private final Map selectorMap;

   public JDBCCreateBeanClassInstanceCommand(JDBCStoreManager manager)
      throws Exception
   {
      EntityContainer theContainer = manager.getContainer();
      entityBridge = (JDBCEntityBridge) manager.getEntityBridge();
      beanClass = theContainer.getBeanClass();
      fieldMap = createFieldMap();
      selectorMap = createSelectorMap();
      // use proxy generator to create one implementation
      EntityBridgeInvocationHandler handler = new EntityBridgeInvocationHandler(fieldMap, selectorMap, beanClass);
      Class[] classes = new Class[]{beanClass};
View Full Code Here

Examples of org.openstreetmap.osmosis.core.container.v0_6.EntityContainer

        public void process(ChangeContainer container) {
            if (progressListener.isCanceled()) {
                target.cancel();
                throw new OsmosisRuntimeException("Cancelled by user");
            }
            final EntityContainer entityContainer = container.getEntityContainer();
            final Entity entity = entityContainer.getEntity();
            final ChangeAction changeAction = container.getAction();
            if (changeAction.equals(ChangeAction.Delete)) {
                SimpleFeatureType ft = entity instanceof Node ? OSMUtils.nodeType() : OSMUtils
                        .wayType();
                String id = Long.toString(entity.getId());
View Full Code Here

Examples of org.openstreetmap.osmosis.core.container.v0_6.EntityContainer

                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, id);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
                    container = new WayContainer((Way) entity);
                }
View Full Code Here

Examples of org.openstreetmap.osmosis.core.container.v0_6.EntityContainer

        Iterator<EntityContainer> iterator = Iterators.concat(nodes, ways);
        if (file.getName().endsWith(".pbf")) {
            BlockOutputStream output = new BlockOutputStream(new FileOutputStream(file));
            OsmosisSerializer serializer = new OsmosisSerializer(output);
            while (iterator.hasNext()) {
                EntityContainer entity = iterator.next();
                serializer.process(entity);
            }
            serializer.complete();
        } else {
            XmlWriter writer = new XmlWriter(file, CompressionMethod.None);
            while (iterator.hasNext()) {
                EntityContainer entity = iterator.next();
                writer.process(entity);
            }
            writer.complete();
        }
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.