Exemplo n.º 1
0
  /** PUBLIC: Return if this session is a server session broker. */
  public boolean isServerSessionBroker() {
    for (Iterator sessionEnum = getSessionsByName().values().iterator(); sessionEnum.hasNext(); ) {
      AbstractSession session = (AbstractSession) sessionEnum.next();
      if (session.isServerSession()) {
        return true;
      }
    }

    return false;
  }
 /** Verifies that the object was deleted from the database correctly. */
 public void verifyDelete(Object writtenObject, String persistenceUnit) {
   AbstractSession dbs = getDatabaseSession(persistenceUnit);
   boolean ok;
   if (dbs.isServerSession()) {
     ok = ((ServerSession) dbs).acquireClientSession().verifyDelete(writtenObject);
   } else if (dbs.isSessionBroker()) {
     ok = ((SessionBroker) dbs).acquireClientSessionBroker().verifyDelete(writtenObject);
   } else {
     ok = dbs.verifyDelete(writtenObject);
   }
   if (!ok) {
     fail("Object not deleted from the database correctly: " + writtenObject);
   }
 }
 /** INTERNAL: Default the connection pools to all pools if unset. */
 public void initialize(AbstractSession session) {
   super.initialize(session);
   if (getConnectionPools().isEmpty() && session.isServerSession()) {
     getConnectionPools().addAll(((ServerSession) session).getConnectionPools().keySet());
   }
 }