Ejemplo n.º 1
0
 /**
  * locate server - returns all ports registered with a specified ORB for an active server Starts
  * the server if it is not already running.
  */
 public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB
     locateServerForORB(String serverId, String orbId)
         throws com.sun.corba.se.PortableActivationIDL.InvalidORBid,
             com.sun.corba.se.PortableActivationIDL.ServerNotRegistered,
             com.sun.corba.se.PortableActivationIDL.ServerHeldDown {
   org.omg.CORBA.portable.InputStream $in = null;
   try {
     org.omg.CORBA.portable.OutputStream $out = _request("locateServerForORB", true);
     org.omg.PortableInterceptor.ServerIdHelper.write($out, serverId);
     org.omg.PortableInterceptor.ORBIdHelper.write($out, orbId);
     $in = _invoke($out);
     com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result =
         com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read(
             $in);
     return $result;
   } catch (org.omg.CORBA.portable.ApplicationException $ex) {
     $in = $ex.getInputStream();
     String _id = $ex.getId();
     if (_id.equals("IDL:PortableActivationIDL/InvalidORBid:1.0"))
       throw com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.read($in);
     else if (_id.equals("IDL:PortableActivationIDL/ServerNotRegistered:1.0"))
       throw com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.read($in);
     else if (_id.equals("IDL:PortableActivationIDL/ServerHeldDown:1.0"))
       throw com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.read($in);
     else throw new org.omg.CORBA.MARSHAL(_id);
   } catch (org.omg.CORBA.portable.RemarshalException $rm) {
     return locateServerForORB(serverId, orbId);
   } finally {
     _releaseReply($in);
   }
 } // locateServerForORB
Ejemplo n.º 2
0
 /** Useful from external BadServerIdHandlers which need to pick a particular port type. */
 public int getServerPortForType(
     com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location,
     String endPointType)
     throws com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint {
   org.omg.CORBA.portable.InputStream $in = null;
   try {
     org.omg.CORBA.portable.OutputStream $out = _request("getServerPortForType", true);
     com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write(
         $out, location);
     $out.write_string(endPointType);
     $in = _invoke($out);
     int $result = com.sun.corba.se.PortableActivationIDL.TCPPortHelper.read($in);
     return $result;
   } catch (org.omg.CORBA.portable.ApplicationException $ex) {
     $in = $ex.getInputStream();
     String _id = $ex.getId();
     if (_id.equals("IDL:PortableActivationIDL/NoSuchEndPoint:1.0"))
       throw com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.read($in);
     else throw new org.omg.CORBA.MARSHAL(_id);
   } catch (org.omg.CORBA.portable.RemarshalException $rm) {
     return getServerPortForType(location, endPointType);
   } finally {
     _releaseReply($in);
   }
 } // getServerPortForType
 public static synchronized org.omg.CORBA.TypeCode type() {
   if (__typeCode == null) {
     synchronized (org.omg.CORBA.TypeCode.class) {
       if (__typeCode == null) {
         if (__active) {
           return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
         }
         __active = true;
         org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[2];
         org.omg.CORBA.TypeCode _tcOf_members0 = null;
         _tcOf_members0 = org.omg.CORBA.ORB.init().create_string_tc(0);
         _members0[0] = new org.omg.CORBA.StructMember("hostname", _tcOf_members0, null);
         _tcOf_members0 = com.sun.corba.se.PortableActivationIDL.EndPointInfoHelper.type();
         _tcOf_members0 = org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
         _tcOf_members0 =
             org.omg
                 .CORBA
                 .ORB
                 .init()
                 .create_alias_tc(
                     com.sun.corba.se.PortableActivationIDL.EndpointInfoListHelper.id(),
                     "EndpointInfoList",
                     _tcOf_members0);
         _members0[1] = new org.omg.CORBA.StructMember("ports", _tcOf_members0, null);
         __typeCode =
             org.omg
                 .CORBA
                 .ORB
                 .init()
                 .create_struct_tc(
                     com.sun.corba.se.PortableActivationIDL.LocatorPackage
                         .ServerLocationPerORBHelper.id(),
                     "ServerLocationPerORB",
                     _members0);
         __active = false;
       }
     }
   }
   return __typeCode;
 }
Ejemplo n.º 4
0
  public org.omg.CORBA.portable.OutputStream _invoke(
      String $method,
      org.omg.CORBA.portable.InputStream in,
      org.omg.CORBA.portable.ResponseHandler $rh) {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer) _methods.get($method);
    if (__method == null)
      throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue()) {

        /**
         * locate server - returns the port with a specific type for all registered ORBs of an
         * active server. Starts the server if it is not already running.
         */
      case 0: // PortableActivationIDL/Locator/locateServer
        {
          try {
            String serverId = org.omg.PortableInterceptor.ServerIdHelper.read(in);
            String endPoint = in.read_string();
            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerType $result =
                null;
            $result = this.locateServer(serverId, endPoint);
            out = $rh.createReply();
            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerTypeHelper.write(
                out, $result);
          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write(out, $ex);
          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write(out, $ex);
          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write(out, $ex);
          }
          break;
        }

        /**
         * locate server - returns all ports registered with a specified ORB for an active server
         * Starts the server if it is not already running.
         */
      case 1: // PortableActivationIDL/Locator/locateServerForORB
        {
          try {
            String serverId = org.omg.PortableInterceptor.ServerIdHelper.read(in);
            String orbId = org.omg.PortableInterceptor.ORBIdHelper.read(in);
            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB $result =
                null;
            $result = this.locateServerForORB(serverId, orbId);
            out = $rh.createReply();
            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write(
                out, $result);
          } catch (com.sun.corba.se.PortableActivationIDL.InvalidORBid $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.InvalidORBidHelper.write(out, $ex);
          } catch (com.sun.corba.se.PortableActivationIDL.ServerNotRegistered $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.ServerNotRegisteredHelper.write(out, $ex);
          } catch (com.sun.corba.se.PortableActivationIDL.ServerHeldDown $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.ServerHeldDownHelper.write(out, $ex);
          }
          break;
        }

        /** get the port for the endpoint of the locator */
      case 2: // PortableActivationIDL/Locator/getEndpoint
        {
          try {
            String endPointType = in.read_string();
            int $result = (int) 0;
            $result = this.getEndpoint(endPointType);
            out = $rh.createReply();
            out.write_long($result);
          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write(out, $ex);
          }
          break;
        }

        /** Useful from external BadServerIdHandlers which need to pick a particular port type. */
      case 3: // PortableActivationIDL/Locator/getServerPortForType
        {
          try {
            com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB location =
                com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper
                    .read(in);
            String endPointType = in.read_string();
            int $result = (int) 0;
            $result = this.getServerPortForType(location, endPointType);
            out = $rh.createReply();
            out.write_long($result);
          } catch (com.sun.corba.se.PortableActivationIDL.NoSuchEndPoint $ex) {
            out = $rh.createExceptionReply();
            com.sun.corba.se.PortableActivationIDL.NoSuchEndPointHelper.write(out, $ex);
          }
          break;
        }

      default:
        throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }

    return out;
  } // _invoke
 public org.omg.CORBA.TypeCode _type() {
   return com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.type();
 }
 public void _write(org.omg.CORBA.portable.OutputStream o) {
   com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write(
       o, value);
 }
 public void _read(org.omg.CORBA.portable.InputStream i) {
   value =
       com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read(i);
 }