Package net.timewalker.ffmq3

Examples of net.timewalker.ffmq3.FFMQException


           
            // Load available keys
            KeyManager[] keyManagers;
            File keyStoreFile = new File(keyStorePath);
            if (!keyStoreFile.canRead())
                throw new FFMQException("Cannot read keystore file : "+keyStoreFile.getAbsolutePath(),"FS_ERROR");
               
            KeyStore ks = KeyStore.getInstance(keyStoreType);
            log.debug("Created keystore : type=["+ks.getType()+"] provider=["+ks.getProvider()+"]");
            char ksPass[] = keyStorePass.toCharArray();
            char ctPass[] = keyPass.toCharArray();
            log.debug("Loading keystore from "+keyStoreFile.getAbsolutePath());
            InputStream kis = new FileInputStream(keyStoreFile);
            ks.load(kis, ksPass);
            kis.close();
           
            KeyManagerFactory kmf = KeyManagerFactory.getInstance(keyManagerAlgorithm);
            log.debug("Created KeyManagerFactory : algorithm=["+kmf.getAlgorithm()+"] provider=["+kmf.getProvider()+"]");
            log.debug("Initializing KeyManagerFactory with keystore ...");
            kmf.init(ks, ctPass);
           
            keyManagers = kmf.getKeyManagers();
           
            sslContext.init(keyManagers, null, null);
           
            return sslContext;
        }
        catch (JMSException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            throw new FFMQException("Cannot create SSL context","NETWORK_ERROR",e);
        }
    }
View Full Code Here


      InetSocketAddress isa = new InetSocketAddress(bindAddress, listenPort);
      serverSocketChannel.socket().bind(isa,tcpBackLog);
    }
    catch (Exception e)
        {
          throw new FFMQException("Could not configure server socket","NETWORK_ERROR",e);
        }
  }
View Full Code Here

            scheme.equals(PacketTransportType.TCPNIO))
        {
            return new RemoteQueueConnection(providerURL, userName, password, clientID);
        }
        else
            throw new FFMQException("Unknown transport protocol : " + scheme,"INVALID_TRANSPORT_PROTOCOL");
    }
View Full Code Here

            scheme.equals(PacketTransportType.TCPNIO))
      {
            return new RemoteTopicConnection(providerURL, userName, password, clientID);
      }
        else
            throw new FFMQException("Unknown transport protocol : " + scheme,"INVALID_TRANSPORT_PROTOCOL");
    }
View Full Code Here

     * @return a new transport endpoint
     */
    public synchronized PacketTransportEndpoint createEndpoint() throws JMSException
    {
        if (closed || transport.isClosed())
            throw new FFMQException("Transport is closed", "TRANSPORT_CLOSED");
       
        PacketTransportEndpoint endpoint = new PacketTransportEndpoint(nextEndpointId++, this);
        registeredEndpoints.put(new Integer(endpoint.getId()), endpoint);
        return endpoint;
    }
View Full Code Here

   * @throws JMSException
   */
  public final void checkNotClosed() throws JMSException
  {
    if (closed)
      throw new FFMQException("Queue browser enumeration is closed","ENUMERATION_CLOSED");
  }
View Full Code Here

                    .getConstructor(new Class[] { Settings.class })
                    .newInstance(new Object[] { setup.getSettings() });
            }
            catch (ClassNotFoundException e)
            {
                throw new FFMQException("Security connector class not found : "+connectorType,"SECURITY_ERROR",e);
            }
            catch (ClassCastException e)
            {
                throw new FFMQException("Invalid security connector class : "+connectorType,"SECURITY_ERROR",e);
            }
            catch (InstantiationException e)
            {
                throw new FFMQException("Cannot create security connector","SECURITY_ERROR",e.getCause());
            }
            catch (InvocationTargetException e)
            {
                throw new FFMQException("Cannot create security connector","SECURITY_ERROR",e.getTargetException());
            }
            catch (Exception e)
            {
                throw new FFMQException("Cannot create security connector","SECURITY_ERROR",e);
            }
        }
        return connector;
    }
View Full Code Here

        this.autoAcknowledge =
          (session.getAcknowledgeMode() == Session.AUTO_ACKNOWLEDGE ||
           session.getAcknowledgeMode() == Session.DUPS_OK_ACKNOWLEDGE);
       
        if (destination == null)
            throw new FFMQException("Message consumer destination cannot be null","INVALID_DESTINATION");
    }
View Full Code Here

     * @see javax.jms.MessageConsumer#receive(long)
     */
    public final Message receive(long timeout) throws JMSException
    {
        if (messageListener != null)
            throw new FFMQException("Cannot receive messages while a listener is active","INVALID_OPERATION");
       
        AbstractMessage message = receiveFromDestination(timeout,true);
        if (message != null)
        {
          message.ensureDeserializationLevel(MessageSerializationLevel.FULL);
View Full Code Here

        {
            parentHub.getTransport().send(query);
        }
        catch (PacketTransportException e)
        {
            throw new FFMQException("["+fullId+"] Could not send packet on transport : "+e.toString(),"TRANSPORT_ERROR");
        }
   
        try
        {
            responseSemaphore.acquire(transportTimeout*1000L);
        }
        catch (WaitTimeoutException e)
        {
            throw new FFMQException("["+fullId+"] Timeout waiting for server response ("+transportTimeout+"s)","TRANSPORT_ERROR");
        }
       
        if (response == null)
            throw new FFMQException("["+fullId+"] Could not get an answer from server (Transport was closed)","TRANSPORT_ERROR");
               
        if (response instanceof ErrorResponse)
            ((ErrorResponse)response).respawnError();

        if (traceEnabled)
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.FFMQException

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.