Example #1
0
  private void updateProxy() {
    String host = _hostname.getText().toString().trim();
    if (host.length() == 0) {
      _status.setText("No hostname");
      return;
    }

    String s =
        "hello:tcp -h "
            + host
            + " -p 10000:ssl -h "
            + host
            + " -p 10001:udp -h "
            + host
            + " -p 10000";
    com.zeroc.Ice.ObjectPrx prx = _communicator.stringToProxy(s);
    prx = _deliveryMode.apply(prx);
    int timeout = _timeoutSlider.getValue();
    if (timeout != 0) {
      prx = prx.ice_invocationTimeout(timeout);
    }
    _helloPrx = Demo.HelloPrx.uncheckedCast(prx);

    //
    // The batch requests associated to the proxy are lost when we
    // update the proxy.
    //
    _flush.setEnabled(false);

    _status.setText("Ready");
  }
Example #2
0
 private void setCurrentEndpoints(com.zeroc.Ice.ObjectPrx proxy) {
   if (proxy == null) {
     _currentEndpoints = null;
     _toolTip = "Inactive";
   } else {
     String str = proxy.toString();
     int index = str.indexOf(':');
     if (index == -1 || index == str.length() - 1) {
       _currentEndpoints = "";
     } else {
       _currentEndpoints = str.substring(index + 1);
     }
     _toolTip = "Published endpoints: " + _currentEndpoints;
   }
 }
Example #3
0
 com.zeroc.Ice.ObjectPrx apply(com.zeroc.Ice.ObjectPrx prx) {
   switch (this) {
     case TWOWAY:
       {
         prx = prx.ice_twoway();
         break;
       }
     case TWOWAY_SECURE:
       {
         prx = prx.ice_twoway().ice_secure(true);
         break;
       }
     case ONEWAY:
       {
         prx = prx.ice_oneway();
         break;
       }
     case ONEWAY_BATCH:
       {
         prx = prx.ice_batchOneway();
         break;
       }
     case ONEWAY_SECURE:
       {
         prx = prx.ice_oneway().ice_secure(true);
         break;
       }
     case ONEWAY_SECURE_BATCH:
       {
         prx = prx.ice_batchOneway().ice_secure(true);
         break;
       }
     case DATAGRAM:
       {
         prx = prx.ice_datagram();
         break;
       }
     case DATAGRAM_BATCH:
       {
         prx = prx.ice_batchDatagram();
         break;
       }
   }
   return prx;
 }