Examples of EJBLocalObject


Examples of javax.ejb.EJBLocalObject

        setId(id++);
        return null;
    }

    public void ejbPostCreate(Order order) throws CreateException {
        final EJBLocalObject localObject = ctx.getEJBLocalObject();
        System.out.println("post create" + localObject);
        order.getLineItems().add(localObject);
        System.out.println("Order lines items: " + order.getLineItems());
    }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

   @Override
   public EJBLocalObject getEJBLocalObject() throws IllegalStateException
   {
      try
      {
         EJBLocalObject proxy = (EJBLocalObject) container.createProxyLocalEjb21();
         return proxy;
      }
      catch (Exception e)
      {
         throw new IllegalStateException(e);
View Full Code Here

Examples of javax.ejb.EJBLocalObject

     * @throws IOException in case of any IO errors
     */
    private void removeActivities() throws RemoveException, RemoteException {
  // remove the activities from the system
  for (Iterator i = activitiesLocal().iterator(); i.hasNext();){
            EJBLocalObject activity = ((EJBLocalObject)i.next());
      activity.remove();
  }
  activityMapCache = null;
    }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

    // --------------------------------------------------------  Public Methods

    public void setPrecededBy(TreeLocal precedingNode)
    {
        EJBLocalObject self = getEntityContext().getEJBLocalObject();
        if (precedingNode == null)
        {
            setSortOrder(1);
        }
        else if (self.isIdentical(precedingNode))
        {
            System.out.println("MenuResource " + getId() + ": "
                                + "attempt to set menu resource "
                                + precedingNode.getId()
                                + " as preceding node; cannot set a node as "
View Full Code Here

Examples of javax.ejb.EJBLocalObject

    * @ejb.interface-method
    */
   public Object getIdViaEJBLocalObject()
   {
      Object key = mEntityContext.getPrimaryKey();
      EJBLocalObject local = mEntityContext.getEJBLocalObject();
      Object lkey = local.getPrimaryKey();
      log.info("key: "+key+", lkey: "+lkey+", local: "+local);
      return (Object)mEntityContext.getEJBLocalObject().getPrimaryKey();
   }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

   * <p>Alternatively, override getSessionBeanInstance and
   * releaseSessionBeanInstance to change EJB instance creation,
   * for example to hold a single shared EJB instance.
   */
  public Object invoke(MethodInvocation invocation) throws Throwable {
    EJBLocalObject ejb = null;
    try {
      ejb = getSessionBeanInstance();
      Method method = invocation.getMethod();
      if (method.getDeclaringClass().isInstance(ejb)) {
        // directly implemented
        return method.invoke(ejb, invocation.getArguments());
      }
      else {
        // not directly implemented
        Method ejbMethod = ejb.getClass().getMethod(method.getName(), method.getParameterTypes());
        return ejbMethod.invoke(ejb, invocation.getArguments());
      }
    }
    catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
View Full Code Here

Examples of javax.ejb.EJBLocalObject

     * @param containerHelper a helper instance for the request.
     * @param context an EJBContext of the calling bean.
     * @return a corresponding EJBLocalObject instance to be used by the client.
     */
    public EJBLocalObject getEJBLocalObject(Object pk, Object container, EJBContext context) {
        EJBLocalObject rc = null;
        try {
            rc = ((Container)container).getEJBLocalObjectForPrimaryKey(pk, context);
        } catch (Exception ex) {
            processContainerException(ex);
        }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

    public boolean remove(Object o) {
        logger.finest("---EJBHashSet.remove---"); // NOI18N
        assertIsValid();
        assertInTransaction();
        helper.assertInstanceOfLocalInterfaceImpl(o);
        EJBLocalObject lo = (EJBLocalObject) o;
        return pcSet.remove(helper.convertEJBLocalObjectToPC(lo, pm, true));
    }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

    public boolean contains(Object o) {
        logger.finest("---EJBHashSet.contains---"); // NOI18N
        assertIsValid();
        assertInTransaction();
        helper.assertInstanceOfLocalInterfaceImpl(o);
        EJBLocalObject lo = (EJBLocalObject) o;
        return pcSet.contains(helper.convertEJBLocalObjectToPC(lo, pm, true));
    }
View Full Code Here

Examples of javax.ejb.EJBLocalObject

            new EJBLocalObjectInvocationHandler(proxyInvocationInfoMap,
                                                localIntf);
        localObjImpl = handler;
       
        try {
            EJBLocalObject localObjectProxy = (EJBLocalObject) ejbLocalObjectProxyCtor.newInstance(new Object[]{handler});
            handler.setProxy(localObjectProxy);
        } catch (ClassCastException e) {
            String msg = localStrings.getLocalString("ejb.basecontainer_invalid_local_interface",
                    "Local component interface [{0}] is invalid since it does not extend javax.ejb.EJBLocalObject.", localIntf);
            throw new IllegalArgumentException(msg, e);
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.