Package com.sun.xml.ws.transport.tcp.util

Examples of com.sun.xml.ws.transport.tcp.util.VersionController


        DataInOutUtils.readInts4(inputStream, versionInfo, 4);
       
        final Version clientFramingVersion = new Version(versionInfo[0], versionInfo[1]);
        final Version clientConnectionManagementVersion = new Version(versionInfo[2], versionInfo[3]);
       
        final VersionController versionController = VersionController.getInstance();
       
        final boolean isSupported = versionController.isVersionSupported(
                clientFramingVersion, clientConnectionManagementVersion);
       
        final OutputStream outputStream = connection.openOutputStream();
       
        final Version framingVersion = isSupported ? clientFramingVersion :
            versionController.getClosestSupportedFramingVersion(clientFramingVersion);
        final Version connectionManagementVersion = isSupported ? clientConnectionManagementVersion :
            versionController.getClosestSupportedConnectionManagementVersion(clientConnectionManagementVersion);
       
        DataInOutUtils.writeInts4(outputStream,
                framingVersion.getMajor(),
                framingVersion.getMinor(),
                connectionManagementVersion.getMajor(),
View Full Code Here


        }
        freeConnection(connectionSession);
    }
   
    private static void doSendMagicAndCheckVersions(final Connection connection) throws IOException, VersionMismatchException {
        final VersionController versionController = VersionController.getInstance();
        final Version framingVersion = versionController.getFramingVersion();
        final Version connectionManagementVersion = versionController.getConnectionManagementVersion();
       
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, MessagesMessages.WSTCP_1040_CONNECTION_MANAGER_DO_CHECK_VERSION_ENTER(framingVersion, connectionManagementVersion));
        }
        connection.setDirectMode(true);
       
        final OutputStream outputStream = connection.openOutputStream();
        outputStream.write(TCPConstants.PROTOCOL_SCHEMA.getBytes("US-ASCII"));
       
        DataInOutUtils.writeInts4(outputStream, framingVersion.getMajor(),
                framingVersion.getMinor(),
                connectionManagementVersion.getMajor(),
                connectionManagementVersion.getMinor());
        connection.flush();
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, MessagesMessages.WSTCP_1041_CONNECTION_MANAGER_DO_CHECK_VERSION_SENT());
        }
       
        final InputStream inputStream = connection.openInputStream();
        final int[] versionInfo = new int[4];
       
        DataInOutUtils.readInts4(inputStream, versionInfo, 4);
       
        final Version serverFramingVersion = new Version(versionInfo[0], versionInfo[1]);
        final Version serverConnectionManagementVersion = new Version(versionInfo[2], versionInfo[3]);
       
        connection.setDirectMode(false);
       
        final boolean success = versionController.isVersionSupported(serverFramingVersion, serverConnectionManagementVersion);

        if (!success) {
            throw new VersionMismatchException(MessagesMessages.WSTCP_0006_VERSION_MISMATCH(), serverFramingVersion,
                    serverConnectionManagementVersion);
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.transport.tcp.util.VersionController

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.