@Test public void testUseUDP() { Settings settings = newSettings(); UDPConnectorServer.Factory udpServerFactory = Factories.newInstance(settings, UDP_CONNECTOR_SERVER_FACTORY_KEY); Settings saSettings = newSettings(); saSettings.put(SA_UNICAST_PREFER_TCP, false); testUnicast(udpServerFactory.newUDPConnectorServer(settings), saSettings); }
public static StandardServiceAgentClient newInstance(Settings settings) { UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY); TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY); return new StandardServiceAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings); }
StandardServiceAgentClient implements ServiceAgentClient { public static StandardServiceAgentClient newInstance(Settings settings) { UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY); TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY); return new StandardServiceAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings); } }
StandardServiceAgentClient implements ServiceAgentClient { public static StandardServiceAgentClient newInstance(Settings settings) { UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY); TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY); return new StandardServiceAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings); } StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector);  StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector, Settings settings); }
StandardServiceAgentClient implements ServiceAgentClient { public static StandardServiceAgentClient newInstance(Settings settings) { UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY); TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY); return new StandardServiceAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings); } StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector);  StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector, Settings settings); static StandardServiceAgentClient newInstance(Settings settings); int getPort(); void setPort(int port); String getConnectAddress(); void setConnectAddress(String connectAddress); boolean isUnicastPreferTCP(); void setUnicastPreferTCP(boolean preferTCP); void register(ServiceInfo service); void addAttributes(ServiceURL serviceURL, String language, Attributes attributes); void removeAttributes(ServiceURL serviceURL, String language, Attributes attributes); void deregister(ServiceURL serviceURL, String language); }
StandardServiceAgentClient implements ServiceAgentClient { public static StandardServiceAgentClient newInstance(Settings settings) { UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY); TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY); return new StandardServiceAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings); } StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector);  StandardServiceAgentClient(UDPConnector udpConnector, TCPConnector tcpConnector, Settings settings); static StandardServiceAgentClient newInstance(Settings settings); int getPort(); void setPort(int port); String getConnectAddress(); void setConnectAddress(String connectAddress); boolean isUnicastPreferTCP(); void setUnicastPreferTCP(boolean preferTCP); void register(ServiceInfo service); void addAttributes(ServiceURL serviceURL, String language, Attributes attributes); void removeAttributes(ServiceURL serviceURL, String language, Attributes attributes); void deregister(ServiceURL serviceURL, String language);  }