| 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 java.util.HashMap; | 
| 24 |  | 
| 25 | /** | 
| 26 | * Singleton scope. | 
| 27 | * | 
| 28 | * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> | 
| 29 | * @version $JDTAUS: SingletonScope.java 8641 2012-09-27 06:45:17Z schulte $ | 
| 30 | */ | 
| 31 | class SingletonScope extends HashMap implements Scope | 
| 32 | { | 
| 33 |  | 
| 34 | /** | 
| 35 | * Creates a new {@code SingletonScope} instance initializing the instance | 
| 36 | * with an initial capacity of {@code 1024}. | 
| 37 | */ | 
| 38 | SingletonScope() | 
| 39 | { | 
| 40 | super( 1024 ); | 
| 41 | } | 
| 42 |  | 
| 43 | /** | 
| 44 | * {@inheritDoc} | 
| 45 | * | 
| 46 | * @see HashMap#get(java.lang.Object) | 
| 47 | */ | 
| 48 | public Object getObject( final String identifier ) | 
| 49 | { | 
| 50 | return this.get( identifier ); | 
| 51 | } | 
| 52 |  | 
| 53 | /** | 
| 54 | * {@inheritDoc} | 
| 55 | * | 
| 56 | * @see HashMap#put(java.lang.Object, java.lang.Object) | 
| 57 | */ | 
| 58 | public Object putObject( final String identifier, final Object object ) | 
| 59 | { | 
| 60 | return this.put( identifier, object ); | 
| 61 | } | 
| 62 |  | 
| 63 | /** | 
| 64 | * {@inheritDoc} | 
| 65 | * | 
| 66 | * @see HashMap#remove(java.lang.Object) | 
| 67 | */ | 
| 68 | public Object removeObject( final String identifier ) | 
| 69 | { | 
| 70 | return this.remove( identifier ); | 
| 71 | } | 
| 72 |  | 
| 73 | } |