Package be.demmel.jgws.packets.handlers

Examples of be.demmel.jgws.packets.handlers.PacketHandler


    Map<Class<? extends Packet>, PacketHandler> packetHandlers = new HashMap<>();

    // create a PacketHandler instance for every Packet class
    for (Class<? extends PacketHandler> packetHandlerClass : packetHandlerClasses) {
      // Create a new instance of the PacketHandler
      PacketHandler packetHandlerInstance = packetHandlerClass.newInstance();

      // Check what Packet class this PacketHandler handles
      Class<? extends Packet> packetClass = packetHandlerInstance.getPacketClass();
      LOGGER.info("\"{}\" handles Packet class: {}", packetHandlerClass, packetClass);

      // Make sure that there no PacketHandler that handles this Packet class yet
      if (packetHandlers.containsKey(packetClass)) {
        throw new IllegalStateException("Found a second PacketHandler (" + packetHandlerClass + ") that handles Packet class \"" + packetClass + "\"");
View Full Code Here

TOP

Related Classes of be.demmel.jgws.packets.handlers.PacketHandler

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.