Package org.omg.CosNotifyChannelAdmin

Examples of org.omg.CosNotifyChannelAdmin.EventChannel


                synchronized(boards) {
                    board = (WhiteBoard)boards.get(name);
                    if (board == null) {
                        System.out.println("Create board "+name);
                        IntHolder _channelId = new IntHolder();
                        EventChannel _channel =
                            channelFactory_.create_channel(new Property[0], new Property[0], _channelId);

                        IntHolder _adminId = new IntHolder();

                        board = new WhiteBoard(orb_, _channel);
View Full Code Here


    public void testDestroyChannelDisconnectsClients() throws Exception
    {
        Property[] _p = new Property[0];
        IntHolder _channelId = new IntHolder();

        EventChannel _channel = getEventChannelFactory().create_channel(_p, _p, _channelId);

        SequencePushSender _pushSender = new SequencePushSender(getClientORB(), testEvent_);
        SequencePullSender _pullSender = new SequencePullSender(getClientORB(), testEvent_);
        SequencePushReceiver _pushReceiver = new SequencePushReceiver(getClientORB());
        SequencePullReceiver _pullReceiver = new SequencePullReceiver(getClientORB());

        _pushSender.connect(_channel, false);
        _pullSender.connect(_channel, false);
        _pushReceiver.connect(_channel, false);
        _pullReceiver.connect(_channel, false);

        assertTrue(_pushSender.isConnected());
        assertTrue(_pullSender.isConnected());
        assertTrue(_pushReceiver.isConnected());
        assertTrue(_pullReceiver.isConnected());

        _channel.destroy();

        try
        {
            Thread.sleep(1000);
        } catch (InterruptedException ie)
View Full Code Here

     */
    public void testDestroyChannelDisconnectsClients() throws Exception
    {
        IntHolder _id = new IntHolder();

        EventChannel _channel = getEventChannelFactory().create_channel(new Property[0],
                new Property[0], _id);

        AnyPullReceiver _anyPullReceiver = new AnyPullReceiver(getClientORB());
        _anyPullReceiver.connect(_channel, false);

        AnyPushReceiver _anyPushReceiver = new AnyPushReceiver(getClientORB());
        _anyPushReceiver.connect(_channel, false);

        AnyPullSender _anyPullSender = new AnyPullSender(getClientORB(), testPerson_);
        _anyPullSender.connect(_channel, false);

        AnyPushSender _anyPushSender = new AnyPushSender(getClientORB(), testPerson_);
        _anyPushSender.connect(_channel, false);

        assertTrue(_anyPullReceiver.isConnected());
        assertTrue(_anyPushReceiver.isConnected());
        assertTrue(_anyPullSender.isConnected());
        assertTrue(_anyPushSender.isConnected());

        _channel.destroy();

        assertTrue(!_anyPullReceiver.isConnected());
        assertTrue(!_anyPushReceiver.isConnected());
        assertTrue(!_anyPullSender.isConnected());
        assertTrue(!_anyPushSender.isConnected());
View Full Code Here

     */
    public void testDestroyAdminDisconnectsClients() throws Exception
    {
        IntHolder _id = new IntHolder();

        EventChannel _channel = getEventChannelFactory().create_channel(new Property[0],
                new Property[0], _id);

        AnyPullReceiver _anyPullReceiver = new AnyPullReceiver(getClientORB());
        _anyPullReceiver.connect(_channel, false);

        AnyPushReceiver _anyPushReceiver = new AnyPushReceiver(getClientORB());
        _anyPushReceiver.connect(_channel, false);

        AnyPullSender _anyPullSender = new AnyPullSender(getClientORB(), testPerson_);
        _anyPullSender.connect(_channel, false);

        AnyPushSender _anyPushSender = new AnyPushSender(getClientORB(), testPerson_);
        _anyPushSender.connect(_channel, false);

        assertTrue(_anyPullReceiver.isConnected());
        assertTrue(_anyPushReceiver.isConnected());
        assertTrue(_anyPullSender.isConnected());
        assertTrue(_anyPushSender.isConnected());

        _anyPullReceiver.myAdmin_.destroy();
        _anyPushReceiver.myAdmin_.destroy();
        _anyPullSender.myAdmin_.destroy();
        _anyPushSender.myAdmin_.destroy();

        assertTrue(!_anyPullReceiver.isConnected());
        assertTrue(!_anyPushReceiver.isConnected());
        assertTrue(!_anyPullSender.isConnected());
        assertTrue(!_anyPushSender.isConnected());

        _channel.destroy();
    }
View Full Code Here

    public void testCreateChannel() throws Exception
    {
        IntHolder _id = new IntHolder();

        EventChannel _channel = getEventChannelFactory().create_channel(new Property[0],
                new Property[0], _id);

        // test if channel id appears within channel list
        int[] _allFactories = getEventChannelFactory().get_all_channels();
       
        assertTrue(containsValue(_allFactories, _id.value));

        EventChannel _sameChannel = getEventChannelFactory().get_event_channel(_id.value);
        assertTrue(_channel._is_equivalent(_sameChannel));

        _channel.destroy();
    }
View Full Code Here

    public void testDestroyChannelDisconnectsClients() throws Exception
    {
        Property[] _p = new Property[0];

        EventChannel _channel = getEventChannelFactory().create_channel(_p, _p, new IntHolder());

        StructuredPushSender _pushSender = getPushSender();

        StructuredPullSender _pullSender = new StructuredPullSender(getClientORB(), testEvent_);
        StructuredPushReceiver _pushReceiver = new StructuredPushReceiver(getClientORB());
        StructuredPullReceiver _pullReceiver = new StructuredPullReceiver(getClientORB());

        _pushSender.connect(_channel, false);
        _pullSender.connect(_channel, false);
        _pushReceiver.connect(_channel, false);
        _pullReceiver.connect(_channel, false);

        assertTrue(_pushSender.isConnected());
        assertTrue(_pullSender.isConnected());
        assertTrue(_pushReceiver.isConnected());
        assertTrue(_pullReceiver.isConnected());

        _channel.destroy();

        assertTrue(!_pushSender.isConnected());
        assertTrue(!_pullSender.isConnected());
        assertTrue(!_pushReceiver.isConnected());
        assertTrue(!_pullReceiver.isConnected());
View Full Code Here

        Property[] qosProps;

        qosProps = new Property[] { new Property(OrderPolicy.value, priorityOrder) };

        EventChannel channel = getEventChannelFactory().create_channel(qosProps, new Property[0], channelId);

        // testdata
        StructuredEvent[] events = new StructuredEvent[10];
        for (int x = 0; x < events.length; ++x)
        {
View Full Code Here

    {
        Any falseAny = getClientORB().create_any();
        falseAny.insert_boolean(false);

        Property[] props = new Property[] { new Property(StopTimeSupported.value, falseAny) };
        EventChannel channel = getEventChannelFactory().create_channel(props, new Property[0], new IntHolder());

        sendEvent(channel, 1000, 500, true);
    }
View Full Code Here

        assertTrue(_receiver.isEventHandled());
    }

    public void testDestroyChannelDisconnectsClients() throws Exception
    {
        EventChannel _channel =
            getEventChannelFactory().create_channel(new Property[0],
                    new Property[0],
                    new IntHolder());

        TestClientOperations[] _testClients = new TestClientOperations[] {
                new CosEventPullSender(getClientORB(), testData_),
                new CosEventPushSender(getClientORB(), testData_),
                new CosEventPushReceiver(getClientORB()),
                new CosEventPullReceiver(getClientORB()) };

        for (int x = 0; x < _testClients.length; ++x)
        {
            _testClients[x].connect(_channel, false);
            assertTrue(_testClients[x].isConnected());
        }

        _channel.destroy();

        Thread.sleep(1000);

        for (int x = 0; x < _testClients.length; ++x)
        {
View Full Code Here

        assertFalse(factory._non_existent());
    }

    public void testDestroy() throws Exception
    {
        EventChannel channel_ = ((EventChannelFactoryImpl)factory_).create_channel(new Property[0], new Property[0], new IntHolder());
        ConsumerAdmin _consumerAdmin = channel_.new_for_consumers(InterFilterGroupOperator.AND_OP,
                new IntHolder());
        SupplierAdmin _supplierAdmin = channel_.new_for_suppliers(InterFilterGroupOperator.AND_OP,
                new IntHolder());

        assertEquals(channel_, _consumerAdmin.MyChannel());
        assertEquals(channel_, _supplierAdmin.MyChannel());

        channel_.destroy();

        try
        {
            channel_.MyFactory();
            fail();
        } catch (OBJECT_NOT_EXIST e)
        {
            // expected
        }
View Full Code Here

TOP

Related Classes of org.omg.CosNotifyChannelAdmin.EventChannel

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.