1 22 23 package org.jboss.util.naming; 24 25 import java.util.Hashtable ; 26 import javax.naming.Context ; 27 import javax.naming.NamingException ; 28 import javax.naming.Name ; 29 import javax.naming.NameParser ; 30 import javax.naming.NamingEnumeration ; 31 import javax.naming.OperationNotSupportedException ; 32 33 41 public class ReadOnlyContext implements Context 42 { 43 44 private Context delegate; 45 46 public ReadOnlyContext(Context delegate) 47 { 48 this.delegate = delegate; 49 } 50 51 public void close() 53 throws NamingException 54 { 55 delegate.close(); 56 } 57 58 public String composeName(String name, String prefix) 59 throws NamingException 60 { 61 return delegate.composeName(name, prefix); 62 } 63 64 public Name composeName(Name name, Name prefix) 65 throws NamingException 66 { 67 return delegate.composeName(name, prefix); 68 } 69 70 public String getNameInNamespace() 71 throws NamingException 72 { 73 return delegate.getNameInNamespace(); 74 } 75 76 public Hashtable getEnvironment() 77 throws NamingException 78 { 79 return delegate.getEnvironment(); 80 } 81 82 public Object lookup(String name) 83 throws NamingException 84 { 85 return delegate.lookup(name); 86 } 87 88 public Object lookupLink(String name) 89 throws NamingException 90 { 91 return delegate.lookupLink(name); 92 } 93 94 public Object lookup(Name name) 95 throws NamingException 96 { 97 return delegate.lookup(name); 98 } 99 100 public Object lookupLink(Name name) 101 throws NamingException 102 { 103 return delegate.lookupLink(name); 104 } 105 106 public NameParser getNameParser(String name) 107 throws NamingException 108 { 109 return delegate.getNameParser(name); 110 } 111 112 public NameParser getNameParser(Name name) 113 throws NamingException 114 { 115 return delegate.getNameParser(name); 116 } 117 118 public NamingEnumeration list(String name) 119 throws NamingException 120 { 121 return delegate.list(name); 122 } 123 124 public NamingEnumeration listBindings(String name) 125 throws NamingException 126 { 127 return delegate.listBindings(name); 128 } 129 130 public NamingEnumeration list(Name name) 131 throws NamingException 132 { 133 return delegate.list(name); 134 } 135 136 public NamingEnumeration listBindings(Name name) 137 throws NamingException 138 { 139 return delegate.listBindings(name); 140 } 141 142 144 public Object addToEnvironment(String propName, Object propVal) 145 throws NamingException 146 { 147 throw new OperationNotSupportedException ("This is a read-only Context"); 148 } 149 150 public void bind(String name, Object obj) 151 throws NamingException 152 { 153 throw new OperationNotSupportedException ("This is a read-only Context"); 154 } 155 public void bind(Name name, Object obj) 156 throws NamingException 157 { 158 throw new OperationNotSupportedException ("This is a read-only Context"); 159 } 160 161 public Context createSubcontext(String name) 162 throws NamingException 163 { 164 throw new OperationNotSupportedException ("This is a read-only Context"); 165 } 166 167 public Context createSubcontext(Name name) 168 throws NamingException 169 { 170 throw new OperationNotSupportedException ("This is a read-only Context"); 171 } 172 173 public void destroySubcontext(String name) 174 throws NamingException 175 { 176 throw new OperationNotSupportedException ("This is a read-only Context"); 177 } 178 179 public void destroySubcontext(Name name) 180 throws NamingException 181 { 182 throw new OperationNotSupportedException ("This is a read-only Context"); 183 } 184 185 public Object removeFromEnvironment(String propName) 186 throws NamingException 187 { 188 throw new OperationNotSupportedException ("This is a read-only Context"); 189 } 190 191 public void rebind(String name, Object obj) 192 throws NamingException 193 { 194 throw new OperationNotSupportedException ("This is a read-only Context"); 195 } 196 197 public void rebind(Name name, Object obj) 198 throws NamingException 199 { 200 throw new OperationNotSupportedException ("This is a read-only Context"); 201 } 202 203 public void rename(String oldName, String newName) 204 throws NamingException 205 { 206 throw new OperationNotSupportedException ("This is a read-only Context"); 207 } 208 209 public void rename(Name oldName, Name newName) 210 throws NamingException 211 { 212 throw new OperationNotSupportedException ("This is a read-only Context"); 213 } 214 215 public void unbind(String name) 216 throws NamingException 217 { 218 throw new OperationNotSupportedException ("This is a read-only Context"); 219 } 220 public void unbind(Name name) 221 throws NamingException 222 { 223 throw new OperationNotSupportedException ("This is a read-only Context"); 224 } 225 226 } 227 | Popular Tags |