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