01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13: package com.sun.portal.portlet.impl;
14:
15: /**
16: * This class uses a thread local object to store the entity ID for the
17: * current request.
18: * <P>
19: * @see PortletRequestImpl#init
20: */
21: public class EntityIDThreadLocal {
22: private static ThreadLocal entityIDThreadLocal = new ThreadLocal();
23:
24: private EntityIDThreadLocal() {
25: // nothing, cannot be called
26: }
27:
28: /**
29: * Gets the entity id.
30: * <P>
31: * @return String the entity id string.
32: */
33: public static String getEntityID() {
34: return (String) entityIDThreadLocal.get();
35: }
36:
37: /**
38: * Sets the entity id.
39: * <P>
40: * @params entityID The portlet entity id
41: */
42: public static void set(String entityID) {
43: entityIDThreadLocal.set(entityID);
44: }
45: }
|