View Javadoc

1   /*
2    *  jDTAUS Core RI Client Container
3    *  Copyright (C) 2005 Christian Schulte
4    *  <cs@schulte.it>
5    *
6    *  This library is free software; you can redistribute it and/or
7    *  modify it under the terms of the GNU Lesser General Public
8    *  License as published by the Free Software Foundation; either
9    *  version 2.1 of the License, or any later version.
10   *
11   *  This library is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   *  Lesser General Public License for more details.
15   *
16   *  You should have received a copy of the GNU Lesser General Public
17   *  License along with this library; if not, write to the Free Software
18   *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19   *
20   */
21  package org.jdtaus.core.container.ri.client;
22  
23  import org.jdtaus.core.container.Context;
24  import org.jdtaus.core.container.ContextFactory;
25  
26  /**
27   * Context scope.
28   *
29   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
30   * @version $JDTAUS: ContextScope.java 8641 2012-09-27 06:45:17Z schulte $
31   *
32   * @see org.jdtaus.core.container.ContainerFactory
33   */
34  class ContextScope implements Scope
35  {
36  
37      /** Creates a new {@code ContextScope} instance. */
38      ContextScope()
39      {
40          super();
41      }
42  
43      /**
44       * {@inheritDoc}
45       *
46       * @see Context#getObject(java.lang.String)
47       */
48      public Object getObject( final String identifier )
49      {
50          return ContextFactory.getContext().getObject( identifier );
51      }
52  
53      /**
54       * {@inheritDoc}
55       *
56       * @see Context#setObject(java.lang.String, java.lang.Object)
57       */
58      public Object putObject( final String identifier, final Object object )
59      {
60          return ContextFactory.getContext().setObject( identifier, object );
61      }
62  
63      /**
64       * {@inheritDoc}
65       *
66       * @see Context#removeObject(java.lang.String)
67       */
68      public Object removeObject( final String identifier )
69      {
70          return ContextFactory.getContext().removeObject( identifier );
71      }
72  
73  }