Package de.fhkn.in.uce.plugininterface.mediator

Examples of de.fhkn.in.uce.plugininterface.mediator.HandleMessage


    @Override
    public void handleMessage(final Message connectionRequestMessage, final Socket controlConnection) throws Exception {
        this.checkForRequiredTravTechAttribute(connectionRequestMessage);
        final NATTraversalTechniqueAttribute usedTravTech = connectionRequestMessage
                .getAttribute(NATTraversalTechniqueAttribute.class);
        final HandleMessage connectionRequestHandler = this.messageHandlerRegistry
                .getConnectionRequestHandlerByEncoding(usedTravTech.getEncoded());
        connectionRequestHandler.handleMessage(connectionRequestMessage, controlConnection);
        if (connectionRequestMessage.isMethod(STUNMessageMethod.CONNECTION_REQUEST)
                && connectionRequestMessage.isSuccessResponse()) {
            // remove only connection requests from list where a response was
            // seen
            this.connectionRequests.removeConnectionRequest(new String(connectionRequestMessage.getHeader()
View Full Code Here


    private static final MessageHandlerRegistry INSTANCE = new MessageHandlerRegistryImpl();
    private final PluginLoader pluginLoader = PluginLoaderImpl.getInstance();

    @Override
    public HandleMessage getConnectionRequestHandlerByEncoding(final int encoding) {
        HandleMessage result = null;
        final Iterator<HandleMessage> handlerIterator = this.pluginLoader.getPluginIterator();
        while (handlerIterator.hasNext()) {
            final HandleMessage handler = handlerIterator.next();
            if (encoding == handler.getAttributeForTraversalTechnique().getEncoded()) {
                result = handler;
                break;
            }
        }
        return result;
View Full Code Here

        Iterator<HandleMessage> iterator = this.serviceLoader.iterator();
        if (!iterator.hasNext()) {
          throw new RuntimeException("No message handler plugins found.");
        }
        while (iterator.hasNext()) {
            HandleMessage handleMessage = (HandleMessage) iterator.next();
            logger.debug("Found plugin for handling connection requests for encoding {}", handleMessage //$NON-NLS-1$
                    .getAttributeForTraversalTechnique().getEncoded());
        }
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.plugininterface.mediator.HandleMessage

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.