Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Reuse remote naming context servant
Changed POA policy to allow user-defined IDs Published policies factory method on SPI Adapted BindingIterator to generate its own servant ID
- Loading branch information
Showing
10 changed files
with
197 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,45 @@ | ||
package org.apache.yoko.orb.util; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.EnumMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public abstract class UnmodifiableEnumMap<K extends Enum<K>, V> extends EnumMap<K, V> { | ||
private static final long serialVersionUID = 1L; | ||
|
||
public UnmodifiableEnumMap(Class<K> keyType) { | ||
super(keyType); | ||
// initialise all values up front to avoid races later | ||
for(K key : keyType.getEnumConstants()) | ||
super.put(key, computeValueFor(key)); | ||
} | ||
|
||
protected abstract V computeValueFor(K key); | ||
|
||
@Override | ||
public final V remove(Object key) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public final V put(K key, V value) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public final void putAll(Map<? extends K, ? extends V> m) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public final Set<K> keySet() { | ||
return Collections.unmodifiableSet(super.keySet()); | ||
} | ||
|
||
@Override | ||
public final Collection<V> values() { | ||
return Collections.unmodifiableCollection(super.values()); | ||
} | ||
} |
Oops, something went wrong.