01: /**
02: * Copyright (C) 2001-2003 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.util.monolog.api;
18:
19: /**
20: * It permits to manage Handler instances.
21: *
22: * @author Sebastien Chassande-Barrioz
23: */
24: public interface HandlerFactory {
25:
26: /**
27: * It retrieves a new instance of an handler which the type is specified
28: * by the parameter.
29: * @param handlertype is the type of the parameter. The possible value are
30: * defined in this interface by the XXX_HANDLER_TYPE constants.
31: * @return a new instance of an handler
32: */
33: Handler createHandler(String hn, String handlertype);
34:
35: /**
36: * It retrieves all handler managed by this factory.
37: * @return a set of Handler instance or an empty set.
38: */
39: Handler[] getHandlers();
40:
41: /**
42: * It retrieves the handler which the name is specified by the parameter
43: * @param handlername is the name of the handler
44: * @return an handler instance or a null value.
45: */
46: Handler getHandler(String handlername);
47:
48: /**
49: * It removes the handler which the name is specified by the parameter
50: * @param handlername is the name of the handler
51: * @return the removed handler instance or a null value if it does not
52: * exist.
53: */
54: Handler removeHandler(String handlername);
55: }
|