Package net.jini.io.context

Examples of net.jini.io.context.ClientHost


                ObjectInputStream in,
                Collection context)
      throws IOException, ClassNotFoundException
  {
      long callId = in.readLong();
      ClientHost client = null;
      try {
    client = (ClientHost)
        ServerContext.getServerContextElement(ClientHost.class);
      } catch (ServerNotActiveException e) {
      }
      int result = JOptionPane.showConfirmDialog(
    null,
    "Permit incoming remote call?" +
    "\n  Client: " + (client != null
          ? client.toString() : "not active") +
    "\n  Object: " + obj +
    "\n  Method: " + method.getName() +
    "\n  Call id: " + callId,
    "Permit incoming remote call?",
    JOptionPane.OK_CANCEL_OPTION);
View Full Code Here


    private LocalAccess() {
    }

    public static synchronized void check() {
  ClientHost host = null;
  try {
      host = (ClientHost)
    ServerContext.getServerContextElement(ClientHost.class);
  } catch (ServerNotActiveException e) {
      return;
  }
  if (host == null) return;
  InetAddress addr = host.getClientHost();
  Boolean ok = (Boolean) cache.get(addr);
  if (ok == null) {
      try {
    ok = Boolean.valueOf(NetworkInterface.getByInetAddress(
          addr) != null);
View Full Code Here

  }
  public boolean integrityEnforced() { return integrity; }
    }

    public static InetAddress getClientHost() throws ServerNotActiveException {
  ClientHost ch = (ClientHost)
      ServerContext.getServerContextElement(ClientHost.class);
  return (ch != null) ? ch.getClientHost() : null;
    }
View Full Code Here

  }
  public boolean integrityEnforced() { return integrity; }
    }

    public static InetAddress getClientHost() throws ServerNotActiveException {
  ClientHost ch = (ClientHost)
      ServerContext.getServerContextElement(ClientHost.class);
  return (ch != null) ? ch.getClientHost() : null;
    }
View Full Code Here

       
    }

    public void testLocalClientHost() throws UnknownHostException {
        Collection col = new ArrayList(1);
        col.add(new ClientHost() {
            public InetAddress getClientHost() {
                try {
                    return InetAddress.getLocalHost();
                }
                catch(UnknownHostException e) {
View Full Code Here

        }, col);
    }

    public void testLoopBackClientHost() {
        Collection col = new ArrayList(1);
        col.add(new ClientHost() {
            public InetAddress getClientHost() {
                try {
                    return InetAddress.getByName("127.0.1.1");
                }
                catch(UnknownHostException e) {
View Full Code Here

       
    }

    public void testRemoteClientHost() {
        Collection col = new ArrayList(1);
        col.add(new ClientHost() {
            public InetAddress getClientHost() {
                try {
                    return InetAddress.getByName("www.apache.org");
                }
                catch(UnknownHostException e) {
View Full Code Here

     * the call will be accepted.
     *
     * @throws AccessControlException when the origin is not a local host
     */
    public static synchronized void check() {
  ClientHost host = null;
  try {
      host = (ClientHost)
    ServerContext.getServerContextElement(ClientHost.class);
  } catch (ServerNotActiveException e) {
      return;
  }
  if (host == null) return;
  InetAddress addr = host.getClientHost();
  Boolean ok = (Boolean) cache.get(addr);
  if (ok == null) {
      try {
    ok = Boolean.valueOf(addr != null && (NetworkInterface.getByInetAddress(
          addr) != null || addr.isLoopbackAddress()));
View Full Code Here

    }
   
    public String getClientHost()
  throws RemoteException, ServerNotActiveException
    {
  ClientHost ch = (ClientHost)
      ServerContext.getServerContextElement(ClientHost.class);
  if (ch != null) {
      return ch.getClientHost().toString();
  } else {
      throw new Error("no ClientHost instance in context");
  }
    }
View Full Code Here

                ObjectInputStream in,
                Collection context)
      throws IOException, ClassNotFoundException
  {
      long callId = in.readLong();
      ClientHost client = null;
      try {
    client = (ClientHost)
        ServerContext.getServerContextElement(ClientHost.class);
      } catch (ServerNotActiveException e) {
      }
      int result = JOptionPane.showConfirmDialog(
    null,
    "Permit incoming remote call?" +
    "\n  Client: " + (client != null
          ? client.getClientHost() : "not active") +
    "\n  Object: " + obj +
    "\n  Method: " + method.getName() +
    "\n  Call id: " + callId,
    "Permit incoming remote call?",
    JOptionPane.OK_CANCEL_OPTION);
View Full Code Here

TOP

Related Classes of net.jini.io.context.ClientHost

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.