Examples of Handle


Examples of javax.ejb.Handle

      getLog().debug("Bean == 3?");
      assertTrue(bean.getCounter() == 3);
      getLog().debug("passes..");

      // Get handle and serialize
      Handle             beanHandle = bean.getHandle();
      FileOutputStream   out        = new FileOutputStream("abean.ser");
      ObjectOutputStream s          = new ObjectOutputStream(out);

      s.writeObject(beanHandle);
      s.flush();
View Full Code Here

Examples of javax.ejb.Handle

      StatefulSession bean = null;
      getLog().debug("Resurrect bean from .ser file");
      FileInputStream   in         = new FileInputStream("abean.ser");
      ObjectInputStream s          = new ObjectInputStream(in);
      Handle beanHandle = ( Handle ) s.readObject();
      bean = ( StatefulSession ) beanHandle.getEJBObject();

      // Should still equal '3'?
      getLog().debug("Bean reanimated, still equal '3'? bean = "
                         + bean.getCounter());
      assertTrue(bean.getCounter() == 3);
View Full Code Here

Examples of javax.ejb.Handle

      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
      InitialContext ctx = new InitialContext(env);
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSession bean = home.create("testSessionHandleNoDefaultJNDI");

      Handle beanHandle = bean.getHandle();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(beanHandle);
      oos.flush();
      byte[] bytes = out.toByteArray();

      Properties sysProps = System.getProperties();
      Properties newProps = new Properties(sysProps);
      newProps.setProperty("java.naming.factory.initial", "badFactory");
      newProps.setProperty("java.naming.provider.url", "jnp://badhost:12345");
      System.setProperties(newProps);
      try
      {
         getLog().debug("Unserialize bean handle...");
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         ObjectInputStream ois = new ObjectInputStream(in);
         beanHandle = (Handle) ois.readObject();
         bean = (StatefulSession) beanHandle.getEJBObject();
         bean.method1("Hello");
         getLog().debug("Called method1 on handle session bean");
      }
      finally
      {
View Full Code Here

Examples of javax.ejb.Handle

      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
      InitialContext ctx = new InitialContext(env);
      StatefulSessionHome home = ( StatefulSessionHome ) ctx.lookup("ejbcts/BMTStatefulSessionBean");
      StatefulSession bean = home.create("testBMTSessionHandleNoDefaultJNDI");

      Handle beanHandle = bean.getHandle();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(beanHandle);
      oos.flush();
      byte[] bytes = out.toByteArray();

      Properties sysProps = System.getProperties();
      Properties newProps = new Properties(sysProps);
      newProps.setProperty("java.naming.factory.initial", "badFactory");
      newProps.setProperty("java.naming.provider.url", "jnp://badhost:12345");
      System.setProperties(newProps);
      try
      {
         getLog().debug("Unserialize bean handle...");
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         ObjectInputStream ois = new ObjectInputStream(in);
         beanHandle = (Handle) ois.readObject();
         bean = (StatefulSession) beanHandle.getEJBObject();
         bean.method1("Hello");
         getLog().debug("Called method1 on handle session bean");
      }
      finally
      {
View Full Code Here

Examples of javax.rules.Handle

     * Test containsObject.
     */
    public void testContainsObject( ) throws Exception
    {
        Person bob = new Person( "bob" );
        Handle handle = statefulSession.addObject( bob );
        assertTrue( "where is bob", statefulSession.containsObject( handle ) );
    }
View Full Code Here

Examples of jdk.internal.org.objectweb.asm.Handle

    public Object mapValue(Object value) {
        if (value instanceof Type) {
            return mapType((Type) value);
        }
        if (value instanceof Handle) {
            Handle h = (Handle) value;
            return new Handle(h.getTag(), mapType(h.getOwner()), mapMethodName(
                    h.getOwner(), h.getName(), h.getDesc()),
                    mapMethodDesc(h.getDesc()));
        }
        return value;
    }
View Full Code Here

Examples of jtermios.windows.WinAPI.HANDLE

  public void test1() {
    System.out.println("A contorted loopback test with overlapped IO for WinAPI");

    String COM = "COM5:";
    HANDLE hComm = CreateFileA(COM, GENERIC_READ | GENERIC_WRITE, 0, null, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, null);

    check(SetupComm(hComm, 2048, 2048), "SetupComm ");

    DCB dcb = new DCB();
    dcb.DCBlength = dcb.size();
View Full Code Here

Examples of nginx.clojure.asm.Handle

    public Object mapValue(Object value) {
        if (value instanceof Type) {
            return mapType((Type) value);
        }
        if (value instanceof Handle) {
            Handle h = (Handle) value;
            return new Handle(h.getTag(), mapType(h.getOwner()), mapMethodName(
                    h.getOwner(), h.getName(), h.getDesc()),
                    mapMethodDesc(h.getDesc()));
        }
        return value;
    }
View Full Code Here

Examples of nodebox.handle.Handle

    }

    private void createHandleForActiveNode() {
        Node activeNode = getActiveNode();
        if (activeNode != null) {
            Handle handle = null;

            if (getFunctionRepository().hasFunction(activeNode.getHandle())) {
                Function handleFunction = getFunctionRepository().getFunction(activeNode.getHandle());
                try {
                    handle = (Handle) handleFunction.invoke();
                } catch (Exception e) {
                    LOG.log(Level.WARNING, "Error while creating handle for " + activeNode, e);
                }
            }

            if (handle != null) {
                handle.setHandleDelegate(this);
                handle.update();
                viewerPane.setHandle(handle);
            } else {
                viewerPane.setHandle(null);
            }
        }
View Full Code Here

Examples of org.apache.qpid.qmf2.common.Handle

//System.out.println("content = " + content);
//System.out.println("opcode = " + opcode);
//System.out.println("routingKey = " + routingKey);
//System.out.println("contentType = " + contentType);

            Handle handle = new Handle(message.getJMSCorrelationID(), message.getJMSReplyTo());

            if (opcode.equals("_agent_locate_request"))
            {
                handleLocateRequest(handle);
            }
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.