Examples of RequestScope


Examples of de.danet.an.util.logging.RequestScope

     * @ejb.interface-method view-type="remote"
     * @ejb.transaction type="Supports"
     */
    public WfResource resourceByKey (String key)
  throws InvalidKeyException, RemoteException {
        RequestScope scope = RequestLog.enterScope
            (this, "resourceByKey", new Object[] {});
        WfResource res = null;
        try {
            ResourceAssignmentService ras = getRas();
            if (ras == null) {
                throw new UnsupportedOperationException
                    ("No resource assignment service configured.");
            }
            res = ras.resourceByKey(key);
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * @ejb.interface-method view-type="remote"
     * @ejb.transaction type="Supports"
     */
    public Collection authorizers (WfResource resource)
  throws RemoteException {
        RequestScope scope = RequestLog.enterScope
            (this, "authorizers", new Object[] { resource });
        Collection res = null;
        try {
            ResourceAssignmentService ras = getRas();
            if (ras == null) {
                throw new UnsupportedOperationException
                    ("No resource assignment service configured.");
            }
            res = ras.authorizers(resource);
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * @ejb.interface-method view-type="remote"
     * @ejb.transaction type="Supports"
     */
    public WfResource asResource (Principal principal)
  throws RemoteException, InvalidKeyException {
        RequestScope scope = RequestLog.enterScope
            (this, "asResource", new Object[] { principal });
        WfResource res = null;
        try {
            ResourceAssignmentService ras = getRas();
            if (ras == null) {
                throw new UnsupportedOperationException
                    ("No resource assignment service configured.");
            }
            res = ras.asResource(principal);
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * @return the caller principal.
     * @ejb.interface-method view-type="remote"
     * @ejb.transaction type="Supports"
     */
    public Principal caller() {
        RequestScope scope = RequestLog.enterScope
            (this, "caller", new Object[] {});
        Principal res = null;
        try {
            res = ctx.getCallerPrincipal();
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     *
     * @return collection
     * @ejb.interface-method view-type="remote"
     */
    public Collection processDefinitions() {
        RequestScope scope = RequestLog.enterScope
            (this, "processDefinitions", new Object[] {});
  Collection definitions = new ArrayList();
  Connection con = null;
  PreparedStatement prepStmt = null;
  ResultSet rs = null;
  try {
      try {
    con = ds.getConnection();
    prepStmt = con.prepareStatement
        ("SELECT PACKAGEID, PROCESSID FROM PROCESSDEFINITION ");
    rs = prepStmt.executeQuery();
    while (rs.next()) {
        String pkgId = JDBCUtil.getString(ds, rs, 1);
        String prcId = JDBCUtil.getString(ds, rs, 2);
        try {
      definitions.add (lookupProcessDefinition(pkgId, prcId));
        } catch (InvalidKeyException e) {
      logger.debug ("Couldn't find definition, propably"
              + " deleted since key lookup.");
        }
    }
      } finally {
    JDBCUtil.closeAll (rs, prepStmt, con);
      }
  } catch (SQLException se) {
      throw new EJBException(se);
  } catch (OptionalDataException ode) {
      throw new EJBException(ode);
  } catch (IOException ioe) {
      throw new EJBException(ioe);
  } finally {
      scope.leave(definitions);
  }
  return definitions;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * the given ids exists.
     * @ejb.interface-method view-type="remote"
     */
    public ProcessMgr processMgr (String packageId, String processId)
    throws InvalidKeyException {
        RequestScope scope = RequestLog.enterScope
            (this, "processMgr", new Object[] { packageId, processId });
        ProcessMgr res = null;
  try {
      ProcessDefinition procDef
    = lookupProcessDefinition (packageId, processId);
      res = new ProcessMgrStub
    (packageId, processId, procDef.mgrName(), null,
     (ProcessDefinitionDirectoryHome)ctx.getEJBHome(),
     processHome());
  } catch (ResourceNotAvailableException re) {
      throw new EJBException (re);
  } catch (InvalidKeyException ikex) {
            ctx.setRollbackOnly();
      throw ikex;
  } finally {
      scope.leave (res);
  }
  return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * <code>id</code> exists, otherwise <code>false</code>.
     * @ejb.interface-method view-type="remote"
     */
    public boolean processDefinitionExists
  (String packageId, String processId) {
        RequestScope scope = RequestLog.enterScope
            (this, "processDefinitionExists",
             new Object[] { packageId, processId });
        boolean res = false;
  Connection con = null;
  PreparedStatement prepStmt = null;
  ResultSet rs = null;
  try {
      try {
    con = ds.getConnection();
    prepStmt = con.prepareStatement
        ("SELECT DBID FROM PROCESSDEFINITION "
         + "WHERE PACKAGEID = ? AND PROCESSID = ?");
    prepStmt.setString(1, packageId);
    prepStmt.setString(2, processId);
    rs = prepStmt.executeQuery();
    if(rs.next()) {
        res = true;
        return res;
    }
      } finally {
    JDBCUtil.closeAll (rs, prepStmt, con);
      }
  } catch (SQLException se) {
      throw new EJBException(se);
  } finally {
      scope.leave (new Boolean (res));
  }
  return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * @throws ImportException if the input is not a correct.
     * @ejb.interface-method view-type="remote"
     */
    public List importProcessDefinitions(String processDefinitions)
  throws ImportException {
        RequestScope scope = RequestLog.enterScope
            (this, "importProcessDefinitions",
             new Object[] { processDefinitions });
        List res = null;
        try {
            res = importProcessDefinitions
            (new InputSource(new StringReader(processDefinitions)));
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * @throws ImportException if the input is not a correct.
     * @ejb.interface-method view-type="remote"
     */
    public List importProcessDefinitions(byte[] processDefinitions)
  throws ImportException {
        RequestScope scope = RequestLog.enterScope
            (this, "importProcessDefinitions",
             new Object[] { processDefinitions });
        List res = null;
        try {
            res = importProcessDefinitions
      (new InputSource(new ByteArrayInputStream(processDefinitions)));
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of de.danet.an.util.logging.RequestScope

     * (formally) invalid ids.
     * @ejb.interface-method view-type="remote"
     */
    public void removeProcessDefinition(String packageId, String processId)
  throws InvalidKeyException {
        RequestScope scope = RequestLog.enterScope
            (this, "removeProcessDefinition",
             new Object[] { packageId, processId });
        try {
            prepareForRemoval(packageId, processId);
            PreparedStatement prepStmt = null;
            Connection con = null;
            ResultSet rs = null;
            try {
                String processType = packageId + "/" + processId;
                uncacheDefinition (processType);
                con = ds.getConnection();
                prepStmt = con.prepareStatement
                    ("SELECT XPDLREF FROM PROCESSDEFINITION "
                     + "WHERE PACKAGEID = ? AND PROCESSID = ?");
                prepStmt.setString(1, packageId);
                prepStmt.setString(2, processId);
                rs = prepStmt.executeQuery();
                if(!rs.next()) {
                    return;
                }
                long xpdlId = rs.getLong(1);
                rs.close();
                rs = null;
                prepStmt.close();
                prepStmt = null;
                // remove process definition from the database
                prepStmt = con.prepareStatement
                    ("DELETE FROM PROCESSDEFINITION "
                     + "WHERE PACKAGEID = ? AND PROCESSID = ?");
                prepStmt.setString(1, packageId);
                prepStmt.setString(2, processId);
                prepStmt.executeUpdate();
                removeXpdlIfOrphaned(xpdlId);
            } finally {
                JDBCUtil.closeAll (rs, prepStmt, con);
      }
  } catch (SQLException e) {
      throw new EJBException(e);
        } finally {
            scope.leave ();
        }
    }
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.