View Javadoc

1   /*
2    * Copyright 2006-2008 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.osgi.test.platform;
18  
19  import java.util.Properties;
20  
21  import org.osgi.framework.BundleContext;
22  
23  /**
24   * Lifecycle contract for the OSGi platform.
25   * 
26   * @author Costin Leau
27   * 
28   */
29  public interface OsgiPlatform {
30  
31  	/**
32  	 * Starts the OSGi platform.
33  	 * 
34  	 * @throws Exception if starting the platform fails
35  	 */
36  	void start() throws Exception;
37  
38  	/**
39  	 * Stops the OSGi platform.
40  	 * 
41  	 * @throws Exception if stopping the platform fails.
42  	 */
43  	void stop() throws Exception;
44  
45  	/**
46  	 * Returns the {@link java.util.Properties} object used for configuring the
47  	 * underlying OSGi implementation before starting it.
48  	 * 
49  	 * @return platform implementation specific properties
50  	 */
51  	Properties getConfigurationProperties();
52  
53  	/**
54  	 * Returns the bundle context of the returned platform. Useful during
55  	 * startup for installing bundles and interacting with the OSGi instance.
56  	 * 
57  	 * @return platform bundle context
58  	 */
59  	BundleContext getBundleContext();
60  }