Invoked by the server (via the service method) to handle incoming SUBSCRIBE requests.
The default implementation is empty and must be overridden by subclasses to do something useful.
160681
protected void doSubscribe(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException{
    	if (req.isInitial())
			notImplemented(req);
    }
649466
private <T> void manageSubscription(EventStream<T> stream, Consumer<T> consumer) {
        manageSubscription(stream.subscribe(consumer));
    }
951937
function (event) {
    this.debug("Requesting subscription for " + event);
    sendReceive.call(this, {'do': 'subscribe', params: [event]}, function (result) {
        if (result.success) {
            this.debug("Succesfully subscribed to %s", event);
        } else {
            this.debug("Subscription request for %s failed", event);
        }
    });
    this.subscribedEvents.push(event);
}
973854
protected void handleClient(final Socket client) throws IOException {
		final ClientHandler handler = new ClientHandler(client);
		this.executorService.execute(handler);
	}
1301737
public void subscribeToEvent(final EventListener eventListener, final Class<? extends AbstractTaskEvent> eventType) {

		synchronized (this.subscriptions) {

			List<EventListener> subscribers = this.subscriptions.get(eventType);
			if (subscribers == null) {
				subscribers = new ArrayList<EventListener>();
				this.subscriptions.put(eventType, subscribers);
			}
			subscribers.add(eventListener);
		}

	}
1254738
protected void subscriptionResponseReceived(IoSession session,
			SubscriptionMessage subscriptionMessage) {
		log.info("Received {}", subscriptionMessage);
		this.receivedSubscription = subscriptionMessage;

		if (this.sentSubscription == null) {
			log.error(
					"Protocol error: Received a subscription response without sending a request.\n{}",
					subscriptionMessage);
			this._disconnect();
			return;
		}

		if (!this.sentSubscription.equals(this.receivedSubscription)) {
			log.info(
					"Server did not fully accept subscription request.\nOriginal:\n{}\nAmended\n{}",
					this.sentSubscription, this.receivedSubscription);
		}

		for (ConnectionListener listener : this.connectionListeners) {
			listener.subscriptionReceived(this, subscriptionMessage);
		}
	}
165200
@Override
  public void doSubscribeNotificationsRequestEvent(ServerShSession session, SubscribeNotificationsRequest request)
      throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
    // TODO Auto-generated method stub
  }
896805
public static void main(String[] args){

        // Listeners are subscribed by passing them to the #subscribe() method
        bus.subscribe(new ListenerDefinition.SyncAsyncListener());

        // #subscribe() is idem-potent => Multiple calls to subscribe do NOT add the listener more than once (set semantics)
        Object listener = new ListenerDefinition.SyncAsyncListener();
        bus.subscribe(listener);
        bus.subscribe(listener);

        // Classes without handlers will be silently ignored
        bus.subscribe(new Object());
        bus.subscribe(new String());

        bus.publishAsync(new File("/tmp/random.csv")); //returns immediately, publication will continue asynchronously
        bus.post(new File("/tmp/random.csv")).asynchronously(); // same as above

        bus.publish("some message");   // will return after each handler has been invoked
        bus.post("some message").now(); // same as above


    }
992765
public void subscribe(final Class<? extends T> clazz, final EventHandler<? extends T> handler) {
    lock.writeLock().lock();
    try {
      List<EventHandler<? extends T>> list = clazzToListOfHandlersMap.get(clazz);
      if (list == null) {
        list = new LinkedList<EventHandler<? extends T>>();
        clazzToListOfHandlersMap.put(clazz, list);
      }
      list.add(handler);
    } finally {
      lock.writeLock().unlock();
    }
  }
577771
public void subscribe(Observable<M> observable, final boolean pullToRefresh) {

    if (isViewAttached()) {
      getView().showLoading(pullToRefresh);
    }

    unsubscribe();

    subscriber = new Subscriber<M>() {
      private boolean ptr = pullToRefresh;

      @Override public void onCompleted() {
        BaseRxLcePresenter.this.onCompleted();
      }

      @Override public void onError(Throwable e) {
        BaseRxLcePresenter.this.onError(e, ptr);
      }

      @Override public void onNext(M m) {
        BaseRxLcePresenter.this.onNext(m);
      }
    };

    observable.subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(subscriber);
  }
1129826
def handle_response(response)
      type, msgid, error, result = response
      if observable = @requests[msgid]
        @requests[msgid].set_response(result, error)
      else
        warn "unknown response with id=#{msgid}"
      end
    end
973774
public void processRequest(RequestEvent arg0) {
    LOG.trace("request received !");
    synchronized (listeners) {
      Iterator<SipListener> iter = listeners.iterator();
      while (iter.hasNext() == true) {
        SipListener listener = iter.next();
        LOG.trace("calling listener");
        listener.processRequest(arg0);
      }
    }
  }
968373
function subscribe() {
    console.log(' > ', 'init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123']);
    rpcClient.methodCall('init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123'], function (err, res) {
        console.log(err, res);
    });
}
551647
@Override
	public void subscribeToEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) {
		this.eventHandler.subscribeToEvent(eventListener, eventType);
	}
718899
public void register(final Object listener) {
		for (Class clazz = listener.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
			Method[] methods = clazz.getMethods();
			for (Method m : methods) {
				if (!m.isAnnotationPresent(Subscribe.class)) continue;
				Class[] params = m.getParameterTypes();

				if (params.length != 1)
					throw new IllegalArgumentException("Method " + m + " has @Subscribe annotation" +
							"and requires " + params.length +
							" arguments, but event-handling methods must require just one argument");
				Class event = params[0];
				EventHandler handler = new EventHandler(listener, m);
				this.handlersByEventType.put(event, handler);
			}
		}
	}
74318
static <T> void subscribe(Subscriber<? super T> s, Iterator<? extends T> it) {
        if (it == null) {
            error(s, new NullPointerException("The iterator is null"));
            return;
        }

        boolean b;

        try {
            b = it.hasNext();
        } catch (Throwable e) {
            error(s, e);
            return;
        }

        if (!b) {
           complete(s);
            return;
        }

        s.onSubscribe(new IterableSubscription<T>(s, it));

    }
210137
def subscribe(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        self.object.subscribers.add(request.user)
        messages.success(self.request, self.success_message)
        return HttpResponseRedirect(self.get_success_url())