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.service.importer.support;
18  
19  import org.springframework.core.enums.StaticLabeledEnum;
20  
21  /**
22   * Enum-like class containing the OSGi service importer thread context class
23   * loader (TCCL) management options.
24   * 
25   * @author Costin Leau
26   */
27  public class ImportContextClassLoader extends StaticLabeledEnum {
28  
29  	private static final long serialVersionUID = -7054525261814306077L;
30  
31  	/**
32  	 * The TCCL will not be managed upon service invocation.
33  	 */
34  	public static final ImportContextClassLoader UNMANAGED = new ImportContextClassLoader(0, "UNMANAGED");
35  
36  	/**
37  	 * The TCCL will be set to the service provider upon service invocation.
38  	 */
39  	public static final ImportContextClassLoader SERVICE_PROVIDER = new ImportContextClassLoader(1, "SERVICE_PROVIDER");
40  
41  	/**
42  	 * The TCCL will be set to the service provider upon service invocation.
43  	 */
44  	public static final ImportContextClassLoader CLIENT = new ImportContextClassLoader(2, "CLIENT");
45  
46  
47  	/**
48  	 * Constructs a new <code>ImportContextClassLoader</code> instance.
49  	 * 
50  	 * @param code
51  	 * @param label
52  	 */
53  	private ImportContextClassLoader(int code, String label) {
54  		super(code, label);
55  	}
56  
57  }