Examples of LocalConnection


Examples of net.timewalker.ffmq3.local.connection.LocalConnection

   
    protected final void initDestination() throws JMSException
    {
        // Security : a consumer destination may only be set at creation time
        //            so we check permissions here once and for all.
        LocalConnection conn = (LocalConnection)session.getConnection();
        if (conn.isSecurityEnabled())
        {
            if (destination instanceof Queue)
            {
                String queueName = ((Queue)destination).getQueueName();
                if (conn.isRegisteredTemporaryQueue(queueName))
                {
                    // OK, temporary destination
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REQUEST_QUEUE))
                {
                    // Only the internal admin thread can consume on this queue
                    if (conn.getSecurityContext() != null)
                        throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
                {
                    conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                }
                else
                {
                    // Standard queue
                    conn.checkPermission(destination,Action.CONSUME);
                }
            }
            else
            if (destination instanceof Topic)
            {
                String topicName = ((Topic)destination).getTopicName();
                if (conn.isRegisteredTemporaryTopic(topicName))
                {
                    // OK, temporary destination
                }
                else
                {
                    // Standard topic
                    conn.checkPermission(destination,Action.CONSUME);
                }
            }
        }
       
        // Lookup a local destination object from the given reference
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection

        return new CloseConsumerResponse();
    }
   
    private RollbackMessageResponse processRollbackMessage( RollbackMessageQuery query ) throws JMSException
    {
      LocalConnection localConnection = getLocalConnection();
     
        LocalSession localSession = (LocalSession)localConnection.lookupRegisteredSession(query.getSessionId());
        if (localSession != null)
        {
            // Rollback undelivered prefetched messages
            List undeliveredMessageIDs = new ArrayList();
            undeliveredMessageIDs.add(query.getMessageId());
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection

    public Connection openConnection( String userName , String password , String clientID ) throws JMSException
    {
        checkDeployed();
        if (clientID != null)
            ClientIDRegistry.getInstance().register(clientID);
        return new LocalConnection(this,
                       getSecurityContext(userName, password),
                                   clientID);
    }
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection

            if (destination instanceof Queue)
            {
                String queueName = ((Queue)destination).getQueueName();
                if (queueName.equals(FFMQConstants.ADM_REQUEST_QUEUE))
                {
                    LocalConnection conn = (LocalConnection)session.getConnection();
                    conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                    adminRequest = true;
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
                {
                    // Only the internal admin thread can produce on this queue
                    LocalConnection conn = (LocalConnection)session.getConnection();
                    if (conn.getSecurityContext() != null)
                        throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                    adminRequest = true;
                }
            }
           
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection

          boolean adminRequest = false;
            String queueName = queue.getQueueName();
            if (queueName.equals(FFMQConstants.ADM_REQUEST_QUEUE))
            {
                // Only the internal admin thread can browse this queue
                LocalConnection conn = (LocalConnection)session.getConnection();
                if (conn.getSecurityContext() != null)
                    throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                adminRequest = true;
            }
            else
            if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
            {
                LocalConnection conn = (LocalConnection)session.getConnection();
                conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                adminRequest = true;
            }
           
            // For all other destinations
            if (!adminRequest)
View Full Code Here

Examples of net.timewalker.ffmq3.local.connection.LocalConnection

     * @throws JMSException
     */
    public final void dispatch( AbstractMessage message ) throws JMSException
    {
        // Security
        LocalConnection conn = (LocalConnection)getConnection();
        if (conn.isSecurityEnabled())
        {
            Destination destination = message.getJMSDestination();
            if (destination instanceof Queue)
            {
                String queueName = ((Queue)destination).getQueueName();
                if (conn.isRegisteredTemporaryQueue(queueName))
                {
                    // OK, temporary destination
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REQUEST_QUEUE))
                {
                    conn.checkPermission(Resource.SERVER, Action.REMOTE_ADMIN);
                }
                else
                if (queueName.equals(FFMQConstants.ADM_REPLY_QUEUE))
                {
                    // Only the internal admin thread can produce on this queue
                    if (conn.getSecurityContext() != null)
                        throw new FFMQException("Access denied to administration queue "+queueName,"ACCESS_DENIED");
                }
                else
                {
                    // Standard queue
                    conn.checkPermission(destination,Action.PRODUCE);
                }
            }
            else
            if (destination instanceof Topic)
            {
                String topicName = ((Topic)destination).getTopicName();
                if (conn.isRegisteredTemporaryTopic(topicName))
                {
                    // OK, temporary destination
                }
                else
                {
                    // Standard topic
                    conn.checkPermission(destination,Action.PRODUCE);  
                }
            }
            else
                throw new InvalidDestinationException("Unsupported destination : "+destination);
        }
View Full Code Here

Examples of org.apache.cayenne.remote.service.LocalConnection

        // by the page size, to test the last smaller page
        query.setPageSize(pageSize);
        query.addOrdering("db:" + MtTable1.TABLE1_ID_PK_COLUMN, SortOrder.ASCENDING);

        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel clientChannel = new ClientChannel(connection,
                false,
                new MockEventManager(),
View Full Code Here

Examples of org.apache.cayenne.remote.service.LocalConnection

        return CayenneResources.getResources().getAccessStack(MULTI_TIER_ACCESS_STACK);
    }

    private CayenneContext createClientContext() {
        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(serverChannel);
        ClientChannel clientChannel = new ClientChannel(
                connection,
                false,
                new MockEventManager(),
                false);
View Full Code Here

Examples of org.apache.cayenne.remote.service.LocalConnection

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connector = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);

        context = new CayenneContext(new ClientChannel(connector));
    }
View Full Code Here

Examples of org.apache.cayenne.remote.service.LocalConnection

        ClientConnection connection = runtime.getConnection();
        assertNotNull(connection);
        assertTrue(connection instanceof LocalConnection);

        LocalConnection localConnection = (LocalConnection) connection;
        assertTrue(localConnection.getChannel() instanceof ClientServerChannel);
        ClientServerChannel clientServerChannel = (ClientServerChannel) localConnection
                .getChannel();
        assertSame(serverContext, clientServerChannel.getParentChannel());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.