예제 #1
0
 public abstract void getConnection(GetConnectionCallback callback);
예제 #2
0
 internal RouterEndpointsCallback(RoutableReference ir, GetConnectionCallback cb)
 {
     _ir = ir;
     _cb = cb;
 }
예제 #3
0
 public override void getConnection(GetConnectionCallback callback)
 {
     try
     {
         bool compress;
         Ice.ConnectionI connection = getConnection(out compress);
         callback.setConnection(connection, compress);
     }
     catch(Ice.LocalException ex)
     {
         callback.setException(ex);
     }
 }
예제 #4
0
 internal CreateConnectionCallback(RoutableReference rr, EndpointI[] endpoints, GetConnectionCallback cb)
 {
     _rr = rr;
     _endpoints = endpoints;
     _callback = cb;
 }
예제 #5
0
 internal ConnectionCallback(RoutableReference ir, GetConnectionCallback cb, bool cached)
 {
     _ir = ir;
     _cb = cb;
     _cached = cached;
 }
예제 #6
0
        private void getConnectionNoRouterInfo(GetConnectionCallback callback)
        {
            if(_endpoints.Length > 0)
            {
                createConnection(_endpoints, callback);
                return;
            }

            if(_locatorInfo != null)
            {
                _locatorInfo.getEndpoints(this, _locatorCacheTimeout, new LocatorEndpointsCallback(this, callback));
            }
            else
            {
                callback.setException(new Ice.NoEndpointException(ToString()));
            }
        }
예제 #7
0
        protected void createConnection(EndpointI[] allEndpoints, GetConnectionCallback callback)
        {
            EndpointI[] endpoints = filterEndpoints(allEndpoints);
            if(endpoints.Length == 0)
            {
                callback.setException(new Ice.NoEndpointException(ToString()));
                return;
            }

            //
            // Finally, create the connection.
            //
            OutgoingConnectionFactory factory = getInstance().outgoingConnectionFactory();
            if(getCacheConnection() || endpoints.Length == 1)
            {
                //
                // Get an existing connection or create one if there's no
                // existing connection to one of the given endpoints.
                //
                factory.create(endpoints, false, getEndpointSelection(),
                               new CreateConnectionCallback(this, null, callback));
            }
            else
            {
                //
                // Go through the list of endpoints and try to create the
                // connection until it succeeds. This is different from just
                // calling create() with the given endpoints since this might
                // create a new connection even if there's an existing
                // connection for one of the endpoints.
                //

                factory.create(new EndpointI[]{ endpoints[0] }, true, getEndpointSelection(),
                               new CreateConnectionCallback(this, endpoints, callback));
            }
        }
예제 #8
0
 public override void getConnection(GetConnectionCallback callback)
 {
     if(_routerInfo != null)
     {
         //
         // If we route, we send everything to the router's client
         // proxy endpoints.
         //
         _routerInfo.getClientEndpoints(new RouterEndpointsCallback(this, callback));
     }
     else
     {
         getConnectionNoRouterInfo(callback);
     }
 }