Java Code Examples for java.rmi.server.RemoteServer#getClientHost()
The following examples show how to use
java.rmi.server.RemoteServer#getClientHost() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RMIServerImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 2
Source File: MementoService.java From Fourinone with Apache License 2.0 | 5 votes |
String getClientHost(){ String clienthost=null; try{ clienthost = RemoteServer.getClientHost(); }catch(ServerNotActiveException ex){ LogUtil.fine("[MementoService]", "[getClientHost]", ex); } //System.out.println("clienthost:"+clienthost); return clienthost; }
Example 3
Source File: RMIServerImpl.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 4
Source File: RMIServerImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 5
Source File: RMIServerImpl.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 6
Source File: RMIServerImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 7
Source File: RMIServerImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 8
Source File: RMIServerImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 9
Source File: RMIServerImpl.java From Java8CN with Apache License 2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 10
Source File: RMIServerImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 11
Source File: RMIServerImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 12
Source File: RMIServerImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 13
Source File: RMIServerImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 14
Source File: RMIServerImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 15
Source File: RMIServerImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 16
Source File: RMIServerImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }
Example 17
Source File: RMIServerImpl.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static synchronized String makeConnectionId(String protocol, Subject subject) { connectionIdNumber++; String clientHost = ""; try { clientHost = RemoteServer.getClientHost(); /* * According to the rules specified in the javax.management.remote * package description, a numeric IPv6 address (detected by the * presence of otherwise forbidden ":" character) forming a part * of the connection id must be enclosed in square brackets. */ if (clientHost.contains(":")) { clientHost = "[" + clientHost + "]"; } } catch (ServerNotActiveException e) { logger.trace("makeConnectionId", "getClientHost", e); } final StringBuilder buf = new StringBuilder(); buf.append(protocol).append(":"); if (clientHost.length() > 0) buf.append("//").append(clientHost); buf.append(" "); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); String sep = ""; for (Iterator<Principal> it = principals.iterator(); it.hasNext(); ) { Principal p = it.next(); String name = p.getName().replace(' ', '_').replace(';', ':'); buf.append(sep).append(name); sep = ";"; } } buf.append(" ").append(connectionIdNumber); if (logger.traceOn()) logger.trace("newConnectionId","connectionId="+buf); return buf.toString(); }