/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to <code>null</code>, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * <code>null</code> if not set */ public static HttpRoute getForcedRoute(HttpParams params) { if (params == null) { throw new IllegalArgumentException("Parameters must not be null."); } HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(BasicPoolEntry entry) { if (!route.equals(entry.getPlannedRoute())) { throw new IllegalArgumentException ("Entry not planned for this pool." + "\npool: " + route + "\nplan: " + entry.getPlannedRoute()); } numEntries++; }
RouteTracker tracker = uniquePoolEntry.tracker; !tracker.toRoute().equals(route)); } else {
if (!followup.getRoute().equals(roureq.getRoute())) { releaseConnection();
if (!followup.getRoute().equals(roureq.getRoute())) { releaseConnection();
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to <code>null</code>, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * <code>null</code> if not set */ public static HttpRoute getForcedRoute(HttpParams params) { if (params == null) { throw new IllegalArgumentException("Parameters must not be null."); } HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to <code>null</code>, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * <code>null</code> if not set */ public static HttpRoute getForcedRoute(HttpParams params) { if (params == null) { throw new IllegalArgumentException("Parameters must not be null."); } HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to <code>null</code>, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * <code>null</code> if not set */ public static HttpRoute getForcedRoute(HttpParams params) { if (params == null) { throw new IllegalArgumentException("Parameters must not be null."); } HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(final BasicPoolEntry entry) { Args.check(route.equals(entry.getPlannedRoute()), "Entry not planned for this pool"); numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(final BasicPoolEntry entry) { Args.check(route.equals(entry.getPlannedRoute()), "Entry not planned for this pool"); numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(final BasicPoolEntry entry) { Args.check(route.equals(entry.getPlannedRoute()), "Entry not planned for this pool"); numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(BasicPoolEntry entry) { if (!route.equals(entry.getPlannedRoute())) { throw new IllegalArgumentException ("Entry not planned for this pool." + "\npool: " + route + "\nplan: " + entry.getPlannedRoute()); } numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(BasicPoolEntry entry) { if (!route.equals(entry.getPlannedRoute())) { throw new IllegalArgumentException ("Entry not planned for this pool." + "\npool: " + route + "\nplan: " + entry.getPlannedRoute()); } numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(BasicPoolEntry entry) { if (!route.equals(entry.getPlannedRoute())) { throw new IllegalArgumentException ("Entry not planned for this pool." + "\npool: " + route + "\nplan: " + entry.getPlannedRoute()); } numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(final BasicPoolEntry entry) { Args.check(route.equals(entry.getPlannedRoute()), "Entry not planned for this pool"); numEntries++; }
/** * Indicates creation of an entry for this pool. * The entry will <i>not</i> be added to the list of free entries, * it is only recognized as belonging to this pool now. It can then * be passed to {@link #freeEntry freeEntry}. * * @param entry the entry that was created for this pool */ public void createdEntry(BasicPoolEntry entry) { if (!route.equals(entry.getPlannedRoute())) { throw new IllegalArgumentException ("Entry not planned for this pool." + "\npool: " + route + "\nplan: " + entry.getPlannedRoute()); } numEntries++; }
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to {@code null}, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * {@code null} if not set */ public static HttpRoute getForcedRoute(final HttpParams params) { Args.notNull(params, "Parameters"); HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to <code>null</code>, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * <code>null</code> if not set */ public static HttpRoute getForcedRoute(final HttpParams params) { Args.notNull(params, "Parameters"); HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
/** * Obtains the {@link ConnRoutePNames#FORCED_ROUTE FORCED_ROUTE} * parameter value. * {@link #NO_ROUTE} will be mapped to {@code null}, * to allow unsetting in a hierarchy. * * @param params the parameters in which to look up * * @return the forced route set in the argument parameters, or * {@code null} if not set */ public static HttpRoute getForcedRoute(final HttpParams params) { Args.notNull(params, "Parameters"); HttpRoute route = (HttpRoute) params.getParameter(FORCED_ROUTE); if ((route != null) && NO_ROUTE.equals(route)) { // value is explicitly unset route = null; } return route; }
ManagedClientConnection getConnection(final HttpRoute route, final Object state) { Args.notNull(route, "Route"); synchronized (this) { assertNotShutdown(); if (this.log.isDebugEnabled()) { this.log.debug("Get connection for route " + route); } Asserts.check(this.conn == null, MISUSE_MESSAGE); if (this.poolEntry != null && !this.poolEntry.getPlannedRoute().equals(route)) { this.poolEntry.close(); this.poolEntry = null; } if (this.poolEntry == null) { final String id = Long.toString(COUNTER.getAndIncrement()); final OperatedClientConnection conn = this.connOperator.createConnection(); this.poolEntry = new HttpPoolEntry(this.log, id, route, conn, 0, TimeUnit.MILLISECONDS); } final long now = System.currentTimeMillis(); if (this.poolEntry.isExpired(now)) { this.poolEntry.close(); this.poolEntry.getTracker().reset(); } this.conn = new ManagedClientConnectionImpl(this, this.connOperator, this.poolEntry); return this.conn; } }