| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| package npanday.registry; |
| |
| import java.io.InputStream; |
| import java.io.IOException; |
| import java.util.Hashtable; |
| |
| /** |
| * The interface for repositories managed by the <code>RepositoryRegistry</code>. The implementing classes should |
| * provide the methods for accessing the domain specific data. |
| * |
| * @author Shane Isbell |
| */ |
| |
| public interface Repository |
| { |
| |
| /** |
| * Loads the configuration file and configuration properties. In the case below, the <code>inputStream</code> |
| * contains the adapters.txt file and the <code>properties</code> holds the init-params. The init params should be |
| * used to specialize the repository configuration. The example below shows that you can add new properties |
| * to <code>MyRepository</code> but not delete them. |
| * <pre> |
| * <registry-config> |
| * <repositories> |
| * <repository> |
| * <repository-name>adapter</repository-name> |
| * <repository-class>org.jvending.sample.MyRepository</repository-class> |
| * <repository-config>${basedir}/adapters.txt</repository-config> |
| * <init-param> |
| * <param-name>add</param-name> |
| * <param-value>true</param-value> |
| * </init-param> |
| * <init-param> |
| * <param-name>delete</param-name> |
| * <param-value>false</param-value> |
| * </init-param> |
| * </repository> |
| * </repositories> |
| * </registry-config> |
| * </pre> |
| * <p/> |
| * Since this method uses an <code>InputStream</code> parameter, the configuration file can be loaded off of the |
| * local file system or from a specific URL located at an HTTP address. |
| * |
| * @param inputStream the configuration file |
| * @param properties the properties used to configure the repository |
| * @throws IOException thrown on interrupted I/O. Implementing class may also use this exception to throw |
| * other exceptions like invalid properties. |
| */ |
| void load( InputStream inputStream, Hashtable properties ) |
| throws IOException; |
| |
| /** |
| * @param repositoryRegistry |
| */ |
| void setRepositoryRegistry( RepositoryRegistry repositoryRegistry ); |
| |
| } |