Examples of ObjectGraph


Examples of com.impetus.kundera.graph.ObjectGraph

            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        // Create an object graph of the entity object.
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this);
        // Call persist on each node in object graph.
        Node node = graph.getHeadNode();
        try
        {
            // Get write lock before writing object required for transaction.
            lock.writeLock().lock();

            node.setPersistenceDelegator(this);
            node.persist();

            // build flush stack.
            flushManager.buildFlushStack(node, com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);

            // Flushing data.
            flush();

            // Add node to persistence context after successful flush.
            getPersistenceCache().getMainCache().addHeadNode(node);
        }
        finally
        {
            lock.writeLock().unlock();
        }

        // Unlocking object.
        graph.clear();
        graph = null;
        if (log.isDebugEnabled())
        {
            log.debug("Data persisted successfully for entity {}.", e.getClass());
        }
View Full Code Here

Examples of dagger.ObjectGraph

  /**
   * Prepare runtime settings and start all manager instances.
   */
  protected void configureContext(ServletContext context) {
    ObjectGraph injector = getInjector(context);

    // create the runtime settings object
    IStoredSettings runtimeSettings = injector.get(IStoredSettings.class);
    final File baseFolder;

    if (goSettings != null) {
      // Gitblit GO
      baseFolder = configureGO(context, goSettings, goBaseFolder, runtimeSettings);
    } else {
      // servlet container
      WebXmlSettings webxmlSettings = new WebXmlSettings(context);
      String contextRealPath = context.getRealPath("/");
      File contextFolder = (contextRealPath != null) ? new File(contextRealPath) : null;

      // if the base folder dosen't match the default assume they don't want to use express,
      // this allows for other containers to customise the basefolder per context.
      String defaultBase = Constants.contextFolder$ + "/WEB-INF/data";
      String base = lookupBaseFolderFromJndi();
      if (!StringUtils.isEmpty(System.getenv("OPENSHIFT_DATA_DIR")) && defaultBase.equals(base)) {
        // RedHat OpenShift
        baseFolder = configureExpress(context, webxmlSettings, contextFolder, runtimeSettings);
      } else {
        // standard WAR
        baseFolder = configureWAR(context, webxmlSettings, contextFolder, runtimeSettings);
      }

      // Test for Tomcat forward-slash/%2F issue and auto-adjust settings
      ContainerUtils.CVE_2007_0450.test(runtimeSettings);
    }

    // Manually configure IRuntimeManager
    logManager(IRuntimeManager.class);
    IRuntimeManager runtime = injector.get(IRuntimeManager.class);
    runtime.setBaseFolder(baseFolder);
    runtime.getStatus().isGO = goSettings != null;
    runtime.getStatus().servletContainer = context.getServerInfo();
    runtime.start();
    managers.add(runtime);
View Full Code Here

Examples of net.sf.joafip.ograph.ObjectGraph

  private String pathFromRootToObject(final Object sourceObject) {
    final ObjectGraphCreator objectGraphCreator = ObjectGraphCreator
        .getInstance();
    String pathFromRootToObject;
    try {
      final ObjectGraph objectGraph = objectGraphCreator
          .create(rootSourceObject);
      pathFromRootToObject = objectGraphCreator.pathToObject(objectGraph,
          sourceObject);
    } catch (GraphException exception) {
      pathFromRootToObject = "failed create object graph "
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        }
        return data;
    }

    public ObjectGraph returnNestedEJBHome() throws javax.ejb.EJBException{
        ObjectGraph data = null;

        try{
        InitialContext ctx = new InitialContext();

        Object object = ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
        data = new ObjectGraph(object);

        } catch (Exception e){
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        }
        return data;
    }
   
    public ObjectGraph returnNestedEJBObject() throws javax.ejb.EJBException{
        ObjectGraph data = null;

        try{
        InitialContext ctx = new InitialContext();

        EncStatelessHome home = (EncStatelessHome)ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
        EncStatelessObject object = home.create();
        data = new ObjectGraph(object);

        } catch (Exception e){
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        }
        return data;
    }
   
    public ObjectGraph returnNestedEJBMetaData() throws javax.ejb.EJBException{
        ObjectGraph data = null;

        try{
        InitialContext ctx = new InitialContext();

        EncStatelessHome home = (EncStatelessHome)ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
        EJBMetaData object = home.getEJBMetaData();
        data = new ObjectGraph(object);

        } catch (Exception e){
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        }
        return data;
    }
   
    public ObjectGraph returnNestedHandle() throws javax.ejb.EJBException{
        ObjectGraph data = null;

        try{
        InitialContext ctx = new InitialContext();

        EncStatelessHome home = (EncStatelessHome)ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
        EncStatelessObject object = home.create();
        data = new ObjectGraph(object.getHandle());

        } catch (Exception e){
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        try{
            Object obj = initialContext.lookup("client/tests/stateless/EncBean");
            EncStatelessHome expected = (EncStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatelessHome.class);
            assertNotNull("The EJBHome returned from JNDI is null", expected);

            ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
            assertNotNull("The ObjectGraph is null", graph);

            EncStatelessHome actual = (EncStatelessHome)PortableRemoteObject.narrow(graph.getObject(), EncStatelessHome.class);
            assertNotNull("The EJBHome returned is null", actual);
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

        }
    }

    public void test38_returnNestedEJBHome2() {
        try{
            ObjectGraph graph = ejbObject.returnNestedEJBHome();
            assertNotNull("The ObjectGraph is null", graph);

            EncStatelessHome actual = (EncStatelessHome)PortableRemoteObject.narrow(graph.getObject(), EncStatelessHome.class);
            assertNotNull("The EJBHome returned is null", actual);
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.openejb.test.object.ObjectGraph

            assertNotNull("The EJBHome returned from JNDI is null", home);

            EncStatelessObject expected = home.create();
            assertNotNull("The EJBObject created is null", expected);

            ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
            assertNotNull("The ObjectGraph is null", graph);

            EncStatelessObject actual = (EncStatelessObject)PortableRemoteObject.narrow(graph.getObject(), EncStatelessObject.class);
            assertNotNull("The EJBObject returned is null", actual);

            assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
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.