Exemplo n.º 1
0
 private void InitSqlServerQueue()
 {
     TransactionWrapper.RunInTransaction(transaction =>
     {
         using (var cmd = transaction.Connection.CreateCommand())
         {
             cmd.Transaction = transaction;
             cmd.CommandText = string.Format(SqlCommands.CreateQueueTable, ListenerQueue.Trim());
             cmd.ExecuteNonQuery();
         }
     });
 }
Exemplo n.º 2
0
 public BundleEventDispatcher(ListenerQueue<IBundleListener> listeners, BundleEvent evnt)
 {
     m_queueView = listeners.getView();
     m_event = evnt;
 }
Exemplo n.º 3
0
 public AllServiceEventDispatcher(ListenerQueue<IAllServiceListener> listeners, ServiceEvent evnt)
 {
     m_queueView = listeners.getView();
     m_event = evnt;
 }
Exemplo n.º 4
0
 public ServiceEventDispatcher(ListenerQueue<IServiceListener> listeners, ServiceEvent evnt)
 {
     m_queueView = listeners.getView();
     m_event = evnt;
     throw new NotImplementedException("add filtering first!!!");
 }
Exemplo n.º 5
0
 public FrameworkEventDispatcher(ListenerQueue<IFrameworkListener> listeners, FrameworkEvent evnt)
 {
     m_queueView = listeners.getView();
     m_event = evnt;
 }
Exemplo n.º 6
0
        //////////////////////////////////////////////////////////////////////////
        public void Init()
        {
            /*
            After calling this method, this Framework must:
            Be in the Bundle.STARTING state.
            Have a valid Bundle Context.
            Be at start level 0.
            Have event handling enabled.
            Have reified Bundle objects for all installed bundles.
            Have registered any framework services. For example, PackageAdmin, ConditionalPermissionAdmin, StartLevel.
            This Framework will not actually be started until start is called.

            This method does nothing if called when this Framework is in the Bundle.STARTING, Bundle.ACTIVE or Bundle.STOPPING states.
            */

            lock(m_lock)
            {
                if(m_state == BundleState.STARTING ||
                    m_state == BundleState.ACTIVE ||
                    m_state == BundleState.STOPPING)
                    return;

                m_bundleRepository = new CBundleRepository(this);
                m_serviceRegistry = new CServiceRegistry(this);
                m_eventServer = new CEventServer();

                m_bundleListeners = new ListenerQueue<IBundleListener>();
                m_syncBundleListeners = new ListenerQueue<ISynchronousBundleListener>();
                m_frameworkListeners = new ListenerQueue<IFrameworkListener>();
                m_serviceListeners = new ListenerQueue<IServiceListener>();
                m_allServiceListeners = new ListenerQueue<IAllServiceListener>();

                m_state = BundleState.STARTING;
                m_context = new CBundleContext(this, this);
                m_activator = new CSystemBundleActivator();
                m_activator.Start(m_context);
            }
        }