Examples of PersistenceService


Examples of com.wordpress.salaboy.model.persistence.PersistenceService

    WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper(myDb, config);
    srv.start();

        PersistenceServiceProvider.configFile = "remote-config-beans.xml";
        ContextTrackingProvider.configFile = "remote-config-beans.xml";
        PersistenceService persistenceService = PersistenceServiceProvider.getPersistenceService();
        ContextTrackingService trackingService = ContextTrackingProvider.getTrackingService();
        Call call = new Call(1, 1, new Date());
        persistenceService.storeCall(call);
       
        assertNotSame("", call.getId());

        call = persistenceService.loadCall(call.getId());
        assertNotNull(call);

        Emergency emergency = new Emergency();
        persistenceService.storeEmergency(emergency);
        assertNotSame("", emergency.getId());

        emergency = persistenceService.loadEmergency(emergency.getId());
        assertNotNull(emergency);
       
        trackingService.attachEmergency(call.getId(), emergency.getId());

        Procedure procedure = new Procedure("MyProcedure");
        persistenceService.storeProcedure(procedure);
        assertNotSame("", procedure.getId());

        procedure = persistenceService.loadProcedure(procedure.getId());
        assertNotNull(procedure);

        trackingService.attachProcedure(emergency.getId(), procedure.getId());


        Vehicle vehicle = new Ambulance();

        persistenceService.storeVehicle(vehicle);
        assertNotSame("", vehicle.getId());

        vehicle = persistenceService.loadVehicle(vehicle.getId());
        assertNotNull(vehicle);


        trackingService.attachVehicle(procedure.getId(), vehicle.getId());

        Vehicle vehicle2 = new FireTruck();
        persistenceService.storeVehicle(vehicle2);
        assertNotSame("", vehicle2.getId());

        vehicle2 = persistenceService.loadVehicle(vehicle2.getId());
        assertNotNull(vehicle2);

        trackingService.attachVehicle(procedure.getId(), vehicle2.getId());

        ServiceChannel channel = new ServiceChannel("MyChannel");
        persistenceService.storeServiceChannel(channel);
        assertNotSame("", channel.getId());
       
        channel = persistenceService.loadServiceChannel(channel.getId());
        assertNotNull(channel);
       
        trackingService.attachServiceChannel(emergency.getId(), channel.getId());

View Full Code Here

Examples of com.wordpress.salaboy.model.persistence.PersistenceService

*/
public class ProcedureServiceFactory {

    public static ProcedureService createProcedureService(String emergencyId, String procedureName, Map<String, Object> parameters) throws IOException {
 
        PersistenceService persistenceService = PersistenceServiceProvider.getPersistenceService();
        ContextTrackingService trackingService = ContextTrackingProvider.getTrackingService();

        //create a new Procedure: this is the representation of the Procedure Service
        Procedure newProcedure = new Procedure(procedureName);

        //Get the requested ProcedureService from Spring
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("procedures-beans.xml");
        ProcedureService procedureService = (ProcedureService) context.getBean(procedureName);

        //Store the procedure so it has a valid id
        persistenceService.storeProcedure(newProcedure);

        //Configure the ProcedureService
        procedureService.configure(emergencyId, newProcedure, parameters);

        //Update the procedure.
        persistenceService.storeProcedure(newProcedure);

        //the process is attached to the emergency
        trackingService.attachProcedure(emergencyId, newProcedure.getId());

        return procedureService;
View Full Code Here

Examples of javax.jnlp.PersistenceService

  private static boolean loadWebStartProperties() {
    boolean loadOK = true;
    boolean firstTime = false;
    s_prop = new Properties();
   
    PersistenceService ps;

      try {
          ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService");
      } catch (UnavailableServiceException e) {       
          ps = null;
          log.log(Level.SEVERE, e.toString());
          return false;
      }

      FileContents fc = null;
      try {
      fc = ps.get(getCodeBase());
    } catch (MalformedURLException e) {
      log.log(Level.SEVERE, e.toString());
      return false;
    } catch (FileNotFoundException e) {
      try {
        ps.create(getCodeBase(), 16 * 1024);
        ps.setTag(getCodeBase(), PersistenceService.DIRTY);
        fc = ps.get(getCodeBase());
      } catch (Exception e1) {
       
      }
    } catch (IOException e) {
      log.log(Level.SEVERE, e.toString());
View Full Code Here

Examples of net.sf.jasperreports.repo.PersistenceService

                return resourceType.cast(resource);
            }
        }

        final PersistenceUtil persistenceUtil = PersistenceUtil.getInstance(this.jasperReportsContext);
        PersistenceService persistenceService = persistenceUtil.getService(FileRepositoryService.class, resourceType);
        if (persistenceService != null) {
            return resourceType.cast(persistenceService.load(uri, this));
        }
        return null;
    }
View Full Code Here

Examples of org.apache.jetspeed.portal.service.PersistenceService

        String attrValue = null ;

        try
        {
            Object[] params = { this };
            PersistenceService ps = (PersistenceService)ServiceFactory
                                        .getService( PersistenceService.class,
                                                     rundata, params);
            attrValue = ps.getPage().getAttribute( attrName );
            if( attrValue == null )
            {
                attrValue = attrDefValue ;
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.portal.service.PersistenceService

    public void setAttribute( String attrName, String attrValue, RunData rundata )
    {
        try
        {
            Object[] params = { this };
            PersistenceService ps = (PersistenceService)ServiceFactory
                                        .getService( PersistenceService.class,
                                                     rundata, params);
            ps.getPage().setAttribute( attrName, attrValue );
            ps.store();
        }
        catch ( ServiceException e ) {}
    }
View Full Code Here

Examples of org.apache.onami.persist.PersistenceService

    private void doTestNestedTransaction( TestVector testVector )
    {
        final PersistenceModule pm = createPersistenceModuleForTest();
        final Injector injector = Guice.createInjector( pm );
        final PersistenceService persistService = injector.getInstance( PersistenceService.class );
        persistService.start();
        try
        {
            doTestNestedTransaction( testVector, injector.getInstance( TransactionalWorker.class ) );
        }
        finally
        {
            persistService.stop();
        }

    }
View Full Code Here

Examples of org.jbpm.persistence.PersistenceService

    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
    if (jbpmContext != null) {
      // assign id to the given object
      Services services = jbpmContext.getServices();
      if (services.hasService(Services.SERVICENAME_PERSISTENCE)) {
        PersistenceService persistenceService = services.getPersistenceService();
        persistenceService.assignId(object);
      }
    }
  }
View Full Code Here

Examples of org.jbpm.persistence.PersistenceService

   * @return the hibernate session factory, or <code>null</code> if a nonstandard
   * persistence service is configured
   */
  public SessionFactory getSessionFactory()
  {
    PersistenceService persistenceService = getPersistenceService();
    return persistenceService instanceof DbPersistenceService
      ? ((DbPersistenceService) persistenceService).getSessionFactory()
      : null;
  }
View Full Code Here

Examples of org.jbpm.persistence.PersistenceService

   * sets the hibernate session factory into the default configured persistence service, overwriting the configured session factory (if there is one configured).
   * if a nonstandard persistence service is configured, then this call has no effect.
   */
  public void setSessionFactory(SessionFactory sessionFactory)
  {
    PersistenceService persistenceService = getPersistenceService();
    if (persistenceService instanceof DbPersistenceService) {
      DbPersistenceService dbPersistenceService = (DbPersistenceService) persistenceService;
      dbPersistenceService.setSessionFactory(sessionFactory);
    }
  }
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.