• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
2  *
3  * This program and the accompanying materials are made available under
4  * the terms of the Common Public License v1.0 which accompanies this distribution,
5  * and is available at http://www.eclipse.org/legal/cpl-v10.html
6  *
7  * $Id: ClassLoadContext.java,v 1.1.1.1 2004/05/09 16:57:52 vlad_r Exp $
8  */
9 package com.vladium.util;
10 
11 // ----------------------------------------------------------------------------
12 /**
13  * Information context for {@link IClassLoadStrategy#getClassLoader(ClassLoadContext)}.
14  *
15  * @author Vlad Roubtsov, (C) 2003
16  */
17 public
18 class ClassLoadContext
19 {
20     // public: ................................................................
21 
22 
23     /**
24      * Returns the class representing the caller of {@link ClassLoaderResolver}
25      * API. Can be used to retrieve the caller's classloader etc (which may be
26      * different from the ClassLoaderResolver's own classloader) ['null' if caller
27      * resolver could be instantiated due to security restrictions].
28      */
getCallerClass()29     public final Class getCallerClass ()
30     {
31         return m_caller;
32     }
33 
34     // protected: .............................................................
35 
36     // package: ...............................................................
37 
38 
39     /**
40      * This constructor is package-private to restrict instantiation to
41      * {@link ClassLoaderResolver} only.
42      *
43      * @param caller [can be null]
44      */
ClassLoadContext(final Class caller)45     ClassLoadContext (final Class caller)
46     {
47         m_caller = caller;
48     }
49 
50     // private: ...............................................................
51 
52 
53     private final Class m_caller;
54 
55 } // end of class
56 // ----------------------------------------------------------------------------