01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.cms.usecase;
19:
20: import org.apache.avalon.framework.service.ServiceException;
21:
22: /**
23: * Usecase resolver interface.
24: *
25: * @version $Id: UsecaseResolver.java 488305 2006-12-18 15:43:43Z andreas $
26: */
27: public interface UsecaseResolver {
28:
29: /**
30: * The Avalon role.
31: */
32: String ROLE = UsecaseResolver.class.getName();
33:
34: /**
35: * Resolves a usecase object.
36: * @param webappUrl The web application URL.
37: * @param name The name of the usecase.
38: * @return A usecase object.
39: * @throws ServiceException if the object could not be created.
40: */
41: Usecase resolve(String webappUrl, String name)
42: throws ServiceException;
43:
44: /**
45: * Checks if a certain usecase is registered.
46: * @param webappUrl The web application URL.
47: * @param name The usecase name.
48: * @return A boolean value.
49: * @throws ServiceException if an error occurs.
50: */
51: boolean isRegistered(String webappUrl, String name)
52: throws ServiceException;
53:
54: /**
55: * Releases a usecase object.
56: * @param usecase The usecase object.
57: * @throws ServiceException if an error occurs.
58: */
59: void release(Usecase usecase) throws ServiceException;
60:
61: /**
62: * @return The names of all registered usecases in alphabetical order.
63: */
64: String[] getUsecaseNames();
65:
66: /**
67: * @param usecaseName The usecase to register.
68: */
69: void register(String usecaseName);
70:
71: }
|