Package de.danet.an.util.logging

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


     * As the environment is a concurrent multi user environment,
     * <code>WfResource</code> objects may become invalid.
     */
    public Collection workItems (WfResource resource)
        throws NoSuchResourceException {
        RequestScope scope = RequestLog.enterScope
            (this, "workItems", new Object[] { resource });
        Collection res = null;
        try {
            res = getRas().workItems(resource);
        } catch (RemoteException e) {
            throw new EJBException (e);
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here


     * <code>WfResource</code> objects may become invalid.
     */
    public boolean isMemberOfWorkItems
        (WfResource resource, WfAssignment assignment)
        throws NoSuchResourceException {
        RequestScope scope = RequestLog.enterScope
            (this, "isMemberOfWorkItems",
             new Object[] { resource, assignment });
        boolean res = false;
        try {
            res = getRas().isMemberOfWorkItems(resource, assignment);
        } catch (RemoteException e) {
            throw new EJBException (e);
        } finally {
            scope.leave (new Boolean(res));
        }
        return res;
    }
View Full Code Here

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

     * @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

     * @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

     * @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

     * @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

     *
     * @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

     * 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

     * <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

TOP

Related Classes of de.danet.an.util.logging.RequestScope

Copyright © 2018 www.massapicom. 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.