01: /*
02: * Copyright 2005-2007 Noelios Consulting.
03: *
04: * The contents of this file are subject to the terms of the Common Development
05: * and Distribution License (the "License"). You may not use this file except in
06: * compliance with the License.
07: *
08: * You can obtain a copy of the license at
09: * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
10: * language governing permissions and limitations under the License.
11: *
12: * When distributing Covered Code, include this CDDL HEADER in each file and
13: * include the License file at http://www.opensource.org/licenses/cddl1.txt If
14: * applicable, add the following below this CDDL HEADER, with the fields
15: * enclosed by brackets "[]" replaced with your own identifying information:
16: * Portions Copyright [yyyy] [name of copyright owner]
17: */
18:
19: package com.noelios.restlet;
20:
21: import java.util.ArrayList;
22: import java.util.List;
23:
24: import org.restlet.Context;
25: import org.restlet.data.Protocol;
26: import org.restlet.data.Request;
27: import org.restlet.data.Response;
28: import org.restlet.util.Helper;
29:
30: /**
31: * Base connector helper.
32: *
33: * @author Jerome Louvel (contact@noelios.com)
34: */
35: public class ConnectorHelper extends Helper {
36: /** The protocols simultaneously supported. */
37: private List<Protocol> protocols;
38:
39: /**
40: * Constructor.
41: */
42: public ConnectorHelper() {
43: this .protocols = null;
44: }
45:
46: /**
47: * Returns the protocols simultaneously supported.
48: *
49: * @return The protocols simultaneously supported.
50: */
51: public List<Protocol> getProtocols() {
52: if (this .protocols == null)
53: this .protocols = new ArrayList<Protocol>();
54: return this .protocols;
55: }
56:
57: /**
58: * Creates a new context.
59: *
60: * @param loggerName
61: * The JDK's logger name to use for contextual logging.
62: * @return The new context.
63: */
64: public Context createContext(String loggerName) {
65: return null;
66: }
67:
68: /**
69: * Handles a call.
70: *
71: * @param request
72: * The request to handle.
73: * @param response
74: * The response to update.
75: */
76: public void handle(Request request, Response response) {
77: }
78:
79: /** Start hook. */
80: public void start() throws Exception {
81: }
82:
83: /** Stop callback. */
84: public void stop() throws Exception {
85: }
86:
87: }
|