1 6 package com.sun.corba.se.impl.logging ; 7 8 import java.util.logging.Logger ; 9 import java.util.logging.Level ; 10 11 import org.omg.CORBA.OMGVMCID ; 12 import com.sun.corba.se.impl.util.SUNVMCID ; 13 import org.omg.CORBA.CompletionStatus ; 14 import org.omg.CORBA.SystemException ; 15 16 import com.sun.corba.se.spi.orb.ORB ; 17 18 import com.sun.corba.se.spi.logging.LogWrapperFactory; 19 20 import com.sun.corba.se.spi.logging.LogWrapperBase; 21 22 import org.omg.CORBA.INTERNAL ; 23 import org.omg.CORBA.BAD_OPERATION ; 24 import org.omg.CORBA.BAD_PARAM ; 25 import org.omg.CORBA.INV_OBJREF ; 26 27 public class IORSystemException extends LogWrapperBase { 28 29 public IORSystemException( Logger logger ) 30 { 31 super( logger ) ; 32 } 33 34 private static LogWrapperFactory factory = new LogWrapperFactory() { 35 public LogWrapperBase create( Logger logger ) 36 { 37 return new IORSystemException( logger ) ; 38 } 39 } ; 40 41 public static IORSystemException get( ORB orb, String logDomain ) 42 { 43 IORSystemException wrapper = 44 (IORSystemException) orb.getLogWrapper( logDomain, 45 "IOR", factory ) ; 46 return wrapper ; 47 } 48 49 public static IORSystemException get( String logDomain ) 50 { 51 IORSystemException wrapper = 52 (IORSystemException) ORB.staticGetLogWrapper( logDomain, 53 "IOR", factory ) ; 54 return wrapper ; 55 } 56 57 61 public static final int ORT_NOT_INITIALIZED = SUNVMCID.value + 1201 ; 62 63 public INTERNAL ortNotInitialized( CompletionStatus cs, Throwable t ) { 64 INTERNAL exc = new INTERNAL ( ORT_NOT_INITIALIZED, cs ) ; 65 if (t != null) 66 exc.initCause( t ) ; 67 68 if (logger.isLoggable( Level.WARNING )) { 69 Object [] parameters = null ; 70 doLog( Level.WARNING, "IOR.ortNotInitialized", 71 parameters, IORSystemException.class, exc ) ; 72 } 73 74 return exc ; 75 } 76 77 public INTERNAL ortNotInitialized( CompletionStatus cs ) { 78 return ortNotInitialized( cs, null ) ; 79 } 80 81 public INTERNAL ortNotInitialized( Throwable t ) { 82 return ortNotInitialized( CompletionStatus.COMPLETED_NO, t ) ; 83 } 84 85 public INTERNAL ortNotInitialized( ) { 86 return ortNotInitialized( CompletionStatus.COMPLETED_NO, null ) ; 87 } 88 89 public static final int NULL_POA = SUNVMCID.value + 1202 ; 90 91 public INTERNAL nullPoa( CompletionStatus cs, Throwable t ) { 92 INTERNAL exc = new INTERNAL ( NULL_POA, cs ) ; 93 if (t != null) 94 exc.initCause( t ) ; 95 96 if (logger.isLoggable( Level.WARNING )) { 97 Object [] parameters = null ; 98 doLog( Level.WARNING, "IOR.nullPoa", 99 parameters, IORSystemException.class, exc ) ; 100 } 101 102 return exc ; 103 } 104 105 public INTERNAL nullPoa( CompletionStatus cs ) { 106 return nullPoa( cs, null ) ; 107 } 108 109 public INTERNAL nullPoa( Throwable t ) { 110 return nullPoa( CompletionStatus.COMPLETED_NO, t ) ; 111 } 112 113 public INTERNAL nullPoa( ) { 114 return nullPoa( CompletionStatus.COMPLETED_NO, null ) ; 115 } 116 117 public static final int BAD_MAGIC = SUNVMCID.value + 1203 ; 118 119 public INTERNAL badMagic( CompletionStatus cs, Throwable t, Object arg0) { 120 INTERNAL exc = new INTERNAL ( BAD_MAGIC, cs ) ; 121 if (t != null) 122 exc.initCause( t ) ; 123 124 if (logger.isLoggable( Level.WARNING )) { 125 Object [] parameters = new Object [1] ; 126 parameters[0] = arg0 ; 127 doLog( Level.WARNING, "IOR.badMagic", 128 parameters, IORSystemException.class, exc ) ; 129 } 130 131 return exc ; 132 } 133 134 public INTERNAL badMagic( CompletionStatus cs, Object arg0) { 135 return badMagic( cs, null, arg0 ) ; 136 } 137 138 public INTERNAL badMagic( Throwable t, Object arg0) { 139 return badMagic( CompletionStatus.COMPLETED_NO, t, arg0 ) ; 140 } 141 142 public INTERNAL badMagic( Object arg0) { 143 return badMagic( CompletionStatus.COMPLETED_NO, null, arg0 ) ; 144 } 145 146 public static final int STRINGIFY_WRITE_ERROR = SUNVMCID.value + 1204 ; 147 148 public INTERNAL stringifyWriteError( CompletionStatus cs, Throwable t ) { 149 INTERNAL exc = new INTERNAL ( STRINGIFY_WRITE_ERROR, cs ) ; 150 if (t != null) 151 exc.initCause( t ) ; 152 153 if (logger.isLoggable( Level.WARNING )) { 154 Object [] parameters = null ; 155 doLog( Level.WARNING, "IOR.stringifyWriteError", 156 parameters, IORSystemException.class, exc ) ; 157 } 158 159 return exc ; 160 } 161 162 public INTERNAL stringifyWriteError( CompletionStatus cs ) { 163 return stringifyWriteError( cs, null ) ; 164 } 165 166 public INTERNAL stringifyWriteError( Throwable t ) { 167 return stringifyWriteError( CompletionStatus.COMPLETED_NO, t ) ; 168 } 169 170 public INTERNAL stringifyWriteError( ) { 171 return stringifyWriteError( CompletionStatus.COMPLETED_NO, null ) ; 172 } 173 174 public static final int TAGGED_PROFILE_TEMPLATE_FACTORY_NOT_FOUND = SUNVMCID.value + 1205 ; 175 176 public INTERNAL taggedProfileTemplateFactoryNotFound( CompletionStatus cs, Throwable t, Object arg0) { 177 INTERNAL exc = new INTERNAL ( TAGGED_PROFILE_TEMPLATE_FACTORY_NOT_FOUND, cs ) ; 178 if (t != null) 179 exc.initCause( t ) ; 180 181 if (logger.isLoggable( Level.WARNING )) { 182 Object [] parameters = new Object [1] ; 183 parameters[0] = arg0 ; 184 doLog( Level.WARNING, "IOR.taggedProfileTemplateFactoryNotFound", 185 parameters, IORSystemException.class, exc ) ; 186 } 187 188 return exc ; 189 } 190 191 public INTERNAL taggedProfileTemplateFactoryNotFound( CompletionStatus cs, Object arg0) { 192 return taggedProfileTemplateFactoryNotFound( cs, null, arg0 ) ; 193 } 194 195 public INTERNAL taggedProfileTemplateFactoryNotFound( Throwable t, Object arg0) { 196 return taggedProfileTemplateFactoryNotFound( CompletionStatus.COMPLETED_NO, t, arg0 ) ; 197 } 198 199 public INTERNAL taggedProfileTemplateFactoryNotFound( Object arg0) { 200 return taggedProfileTemplateFactoryNotFound( CompletionStatus.COMPLETED_NO, null, arg0 ) ; 201 } 202 203 public static final int INVALID_JDK1_3_1_PATCH_LEVEL = SUNVMCID.value + 1206 ; 204 205 public INTERNAL invalidJdk131PatchLevel( CompletionStatus cs, Throwable t, Object arg0) { 206 INTERNAL exc = new INTERNAL ( INVALID_JDK1_3_1_PATCH_LEVEL, cs ) ; 207 if (t != null) 208 exc.initCause( t ) ; 209 210 if (logger.isLoggable( Level.WARNING )) { 211 Object [] parameters = new Object [1] ; 212 parameters[0] = arg0 ; 213 doLog( Level.WARNING, "IOR.invalidJdk131PatchLevel", 214 parameters, IORSystemException.class, exc ) ; 215 } 216 217 return exc ; 218 } 219 220 public INTERNAL invalidJdk131PatchLevel( CompletionStatus cs, Object arg0) { 221 return invalidJdk131PatchLevel( cs, null, arg0 ) ; 222 } 223 224 public INTERNAL invalidJdk131PatchLevel( Throwable t, Object arg0) { 225 return invalidJdk131PatchLevel( CompletionStatus.COMPLETED_NO, t, arg0 ) ; 226 } 227 228 public INTERNAL invalidJdk131PatchLevel( Object arg0) { 229 return invalidJdk131PatchLevel( CompletionStatus.COMPLETED_NO, null, arg0 ) ; 230 } 231 232 public static final int GET_LOCAL_SERVANT_FAILURE = SUNVMCID.value + 1207 ; 233 234 public INTERNAL getLocalServantFailure( CompletionStatus cs, Throwable t, Object arg0) { 235 INTERNAL exc = new INTERNAL ( GET_LOCAL_SERVANT_FAILURE, cs ) ; 236 if (t != null) 237 exc.initCause( t ) ; 238 239 if (logger.isLoggable( Level.FINE )) { 240 Object [] parameters = new Object [1] ; 241 parameters[0] = arg0 ; 242 doLog( Level.FINE, "IOR.getLocalServantFailure", 243 parameters, IORSystemException.class, exc ) ; 244 } 245 246 return exc ; 247 } 248 249 public INTERNAL getLocalServantFailure( CompletionStatus cs, Object arg0) { 250 return getLocalServantFailure( cs, null, arg0 ) ; 251 } 252 253 public INTERNAL getLocalServantFailure( Throwable t, Object arg0) { 254 return getLocalServantFailure( CompletionStatus.COMPLETED_NO, t, arg0 ) ; 255 } 256 257 public INTERNAL getLocalServantFailure( Object arg0) { 258 return getLocalServantFailure( CompletionStatus.COMPLETED_NO, null, arg0 ) ; 259 } 260 261 265 public static final int ADAPTER_ID_NOT_AVAILABLE = SUNVMCID.value + 1201 ; 266 267 public BAD_OPERATION adapterIdNotAvailable( CompletionStatus cs, Throwable t ) { 268 BAD_OPERATION exc = new BAD_OPERATION ( ADAPTER_ID_NOT_AVAILABLE, cs ) ; 269 if (t != null) 270 exc.initCause( t ) ; 271 272 if (logger.isLoggable( Level.WARNING )) { 273 Object [] parameters = null ; 274 doLog( Level.WARNING, "IOR.adapterIdNotAvailable", 275 parameters, IORSystemException.class, exc ) ; 276 } 277 278 return exc ; 279 } 280 281 public BAD_OPERATION adapterIdNotAvailable( CompletionStatus cs ) { 282 return adapterIdNotAvailable( cs, null ) ; 283 } 284 285 public BAD_OPERATION adapterIdNotAvailable( Throwable t ) { 286 return adapterIdNotAvailable( CompletionStatus.COMPLETED_NO, t ) ; 287 } 288 289 public BAD_OPERATION adapterIdNotAvailable( ) { 290 return adapterIdNotAvailable( CompletionStatus.COMPLETED_NO, null ) ; 291 } 292 293 public static final int SERVER_ID_NOT_AVAILABLE = SUNVMCID.value + 1202 ; 294 295 public BAD_OPERATION serverIdNotAvailable( CompletionStatus cs, Throwable t ) { 296 BAD_OPERATION exc = new BAD_OPERATION ( SERVER_ID_NOT_AVAILABLE, cs ) ; 297 if (t != null) 298 exc.initCause( t ) ; 299 300 if (logger.isLoggable( Level.WARNING )) { 301 Object [] parameters = null ; 302 doLog( Level.WARNING, "IOR.serverIdNotAvailable", 303 parameters, IORSystemException.class, exc ) ; 304 } 305 306 return exc ; 307 } 308 309 public BAD_OPERATION serverIdNotAvailable( CompletionStatus cs ) { 310 return serverIdNotAvailable( cs, null ) ; 311 } 312 313 public BAD_OPERATION serverIdNotAvailable( Throwable t ) { 314 return serverIdNotAvailable( CompletionStatus.COMPLETED_NO, t ) ; 315 } 316 317 public BAD_OPERATION serverIdNotAvailable( ) { 318 return serverIdNotAvailable( CompletionStatus.COMPLETED_NO, null ) ; 319 } 320 321 public static final int ORB_ID_NOT_AVAILABLE = SUNVMCID.value + 1203 ; 322 323 public BAD_OPERATION orbIdNotAvailable( CompletionStatus cs, Throwable t ) { 324 BAD_OPERATION exc = new BAD_OPERATION ( ORB_ID_NOT_AVAILABLE, cs ) ; 325 if (t != null) 326 exc.initCause( t ) ; 327 328 if (logger.isLoggable( Level.WARNING )) { 329 Object [] parameters = null ; 330 doLog( Level.WARNING, "IOR.orbIdNotAvailable", 331 parameters, IORSystemException.class, exc ) ; 332 } 333 334 return exc ; 335 } 336 337 public BAD_OPERATION orbIdNotAvailable( CompletionStatus cs ) { 338 return orbIdNotAvailable( cs, null ) ; 339 } 340 341 public BAD_OPERATION orbIdNotAvailable( Throwable t ) { 342 return orbIdNotAvailable( CompletionStatus.COMPLETED_NO, t ) ; 343 } 344 345 public BAD_OPERATION orbIdNotAvailable( ) { 346 return orbIdNotAvailable( CompletionStatus.COMPLETED_NO, null ) ; 347 } 348 349 public static final int OBJECT_ADAPTER_ID_NOT_AVAILABLE = SUNVMCID.value + 1204 ; 350 351 public BAD_OPERATION objectAdapterIdNotAvailable( CompletionStatus cs, Throwable t ) { 352 BAD_OPERATION exc = new BAD_OPERATION ( OBJECT_ADAPTER_ID_NOT_AVAILABLE, cs ) ; 353 if (t != null) 354 exc.initCause( t ) ; 355 356 if (logger.isLoggable( Level.WARNING )) { 357 Object [] parameters = null ; 358 doLog( Level.WARNING, "IOR.objectAdapterIdNotAvailable", 359 parameters, IORSystemException.class, exc ) ; 360 } 361 362 return exc ; 363 } 364 365 public BAD_OPERATION objectAdapterIdNotAvailable( CompletionStatus cs ) { 366 return objectAdapterIdNotAvailable( cs, null ) ; 367 } 368 369 public BAD_OPERATION objectAdapterIdNotAvailable( Throwable t ) { 370 return objectAdapterIdNotAvailable( CompletionStatus.COMPLETED_NO, t ) ; 371 } 372 373 public BAD_OPERATION objectAdapterIdNotAvailable( ) { 374 return objectAdapterIdNotAvailable( CompletionStatus.COMPLETED_NO, null ) ; 375 } 376 377 381 public static final int BAD_OID_IN_IOR_TEMPLATE_LIST = SUNVMCID.value + 1201 ; 382 383 public BAD_PARAM badOidInIorTemplateList( CompletionStatus cs, Throwable t ) { 384 BAD_PARAM exc = new BAD_PARAM ( BAD_OID_IN_IOR_TEMPLATE_LIST, cs ) ; 385 if (t != null) 386 exc.initCause( t ) ; 387 388 if (logger.isLoggable( Level.WARNING )) { 389 Object [] parameters = null ; 390 doLog( Level.WARNING, "IOR.badOidInIorTemplateList", 391 parameters, IORSystemException.class, exc ) ; 392 } 393 394 return exc ; 395 } 396 397 public BAD_PARAM badOidInIorTemplateList( CompletionStatus cs ) { 398 return badOidInIorTemplateList( cs, null ) ; 399 } 400 401 public BAD_PARAM badOidInIorTemplateList( Throwable t ) { 402 return badOidInIorTemplateList( CompletionStatus.COMPLETED_NO, t ) ; 403 } 404 405 public BAD_PARAM badOidInIorTemplateList( ) { 406 return badOidInIorTemplateList( CompletionStatus.COMPLETED_NO, null ) ; 407 } 408 409 public static final int INVALID_TAGGED_PROFILE = SUNVMCID.value + 1202 ; 410 411 public BAD_PARAM invalidTaggedProfile( CompletionStatus cs, Throwable t ) { 412 BAD_PARAM exc = new BAD_PARAM ( INVALID_TAGGED_PROFILE, cs ) ; 413 if (t != null) 414 exc.initCause( t ) ; 415 416 if (logger.isLoggable( Level.WARNING )) { 417 Object [] parameters = null ; 418 doLog( Level.WARNING, "IOR.invalidTaggedProfile", 419 parameters, IORSystemException.class, exc ) ; 420 } 421 422 return exc ; 423 } 424 425 public BAD_PARAM invalidTaggedProfile( CompletionStatus cs ) { 426 return invalidTaggedProfile( cs, null ) ; 427 } 428 429 public BAD_PARAM invalidTaggedProfile( Throwable t ) { 430 return invalidTaggedProfile( CompletionStatus.COMPLETED_NO, t ) ; 431 } 432 433 public BAD_PARAM invalidTaggedProfile( ) { 434 return invalidTaggedProfile( CompletionStatus.COMPLETED_NO, null ) ; 435 } 436 437 public static final int BAD_IIOP_ADDRESS_PORT = SUNVMCID.value + 1203 ; 438 439 public BAD_PARAM badIiopAddressPort( CompletionStatus cs, Throwable t, Object arg0) { 440 BAD_PARAM exc = new BAD_PARAM ( BAD_IIOP_ADDRESS_PORT, cs ) ; 441 if (t != null) 442 exc.initCause( t ) ; 443 444 if (logger.isLoggable( Level.WARNING )) { 445 Object [] parameters = new Object [1] ; 446 parameters[0] = arg0 ; 447 doLog( Level.WARNING, "IOR.badIiopAddressPort", 448 parameters, IORSystemException.class, exc ) ; 449 } 450 451 return exc ; 452 } 453 454 public BAD_PARAM badIiopAddressPort( CompletionStatus cs, Object arg0) { 455 return badIiopAddressPort( cs, null, arg0 ) ; 456 } 457 458 public BAD_PARAM badIiopAddressPort( Throwable t, Object arg0) { 459 return badIiopAddressPort( CompletionStatus.COMPLETED_NO, t, arg0 ) ; 460 } 461 462 public BAD_PARAM badIiopAddressPort( Object arg0) { 463 return badIiopAddressPort( CompletionStatus.COMPLETED_NO, null, arg0 ) ; 464 } 465 466 470 public static final int IOR_MUST_HAVE_IIOP_PROFILE = SUNVMCID.value + 1201 ; 471 472 public INV_OBJREF iorMustHaveIiopProfile( CompletionStatus cs, Throwable t ) { 473 INV_OBJREF exc = new INV_OBJREF ( IOR_MUST_HAVE_IIOP_PROFILE, cs ) ; 474 if (t != null) 475 exc.initCause( t ) ; 476 477 if (logger.isLoggable( Level.WARNING )) { 478 Object [] parameters = null ; 479 doLog( Level.WARNING, "IOR.iorMustHaveIiopProfile", 480 parameters, IORSystemException.class, exc ) ; 481 } 482 483 return exc ; 484 } 485 486 public INV_OBJREF iorMustHaveIiopProfile( CompletionStatus cs ) { 487 return iorMustHaveIiopProfile( cs, null ) ; 488 } 489 490 public INV_OBJREF iorMustHaveIiopProfile( Throwable t ) { 491 return iorMustHaveIiopProfile( CompletionStatus.COMPLETED_NO, t ) ; 492 } 493 494 public INV_OBJREF iorMustHaveIiopProfile( ) { 495 return iorMustHaveIiopProfile( CompletionStatus.COMPLETED_NO, null ) ; 496 } 497 498 499 } 500 | Popular Tags |