Package org.apache.ws.notification.subscription

Examples of org.apache.ws.notification.subscription.SubscriptionTable


   /**
    * @see SubscriptionTableManager#createSubscriptionTable()
    */
   public SubscriptionTable createSubscriptionTable(  )
   {
      SubscriptionTable table = null;

      try
      {
         m_readyLock.readLock(  ).acquire(  ); // synchronize - reader

         if ( m_ready )
         {
            table = new MemorySubscriptionTable(  );

            synchronized ( m_subscriptions )
            {
               m_subscriptions.put( table.getTableId(  ),
                                    table );
            }

            LOG.debug( MSG.getMessage( Keys.CREATE_SUB_TABLE,
                                       table.getTableId(  ) ) );
         }
         else
         {
            LOG.info( "Subscription manager is not initialized, subscription table not created" );
         }
View Full Code Here


      // Clear out any expired subscriptions and then remove any tables that happen to be empty.
      Object[] keys = m_subscriptions.keySet(  ).toArray(  );

      for ( int i = 0; i < keys.length; i++ )
      {
         SubscriptionTable table = (SubscriptionTable) m_subscriptions.get( keys[i] );

         table.removeExpiredSubscriptions(  );

         if ( table.getSubscriptionCount(  ) == 0 )
         {
            m_subscriptions.remove( keys[i] );
         }
      }
View Full Code Here

   {
      SubscriptionTableManager mgr = SubscriptionTableManagerFactory.createSubscriptionTableManager(  );

      mgr.initialize(  );

      SubscriptionTable table = mgr.createSubscriptionTable(  );

      Subscription      sub1  = createSubscription( 1 );
      Subscription      sub2  = createSubscription( 2 );
      Subscription      sub3  = createSubscription( 3 );
      Subscription      xsub4 = createExpiredSubscription( 4 );
      Subscription      xsub5 = createExpiredSubscription( 5 );

      table.addSubscription( sub1 );
      table.addSubscription( sub2 );
      table.addSubscription( sub3 );
      table.addSubscription( xsub4 );
      table.addSubscription( xsub5 );

      assertEquals( "3 subscriptions should have been left", 3,
                    table.getSubscribers( sub1.getResourceProps(  ).getTopicExpression(  ) ).length );

      mgr.shutdown(  );

      return;
   }
View Full Code Here

    * Make sure subscription tables and manager are serializable.
    */
   public void testSubscriptionTableSerialization(  )
   {
      SubscriptionTableManager mgr;
      SubscriptionTable        table;
      Subscription             t1;
      Subscription             t2;

      mgr =
         SubscriptionTableManagerFactory.createSubscriptionTableManager( SubscriptionTableManagerFactory.MANAGER_TYPE_MEMORY );

      mgr.initialize(  );

      table    = mgr.createSubscriptionTable(  );
      t1       = createSubscription( 1 );
      t2       = createSubscription( 2 );

      table.addSubscription( t1 );
      table.addSubscription( t2 );

      assertEquals( 2,
                    table.getSubscriptionCount(  ) );

      t1       = (Subscription) roundTrip( t1 );
      table    = (SubscriptionTable) roundTrip( table );
      mgr      = (SubscriptionTableManager) roundTrip( mgr );

      // make sure the deserialized table maintained its subscriptions
      assertEquals( 2,
                    table.getSubscriptionCount(  ) );

      mgr.shutdown(  );
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.subscription.SubscriptionTable

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.