1 7 package com.sun.corba.se.impl.naming.namingutil; 8 9 import org.omg.CORBA.CompletionStatus ; 10 import java.util.StringTokenizer ; 11 12 17 18 public class INSURLHandler { 19 20 private static INSURLHandler insURLHandler = null; 21 22 private static final int CORBALOC_PREFIX_LENGTH = 9; 24 25 private static final int CORBANAME_PREFIX_LENGTH = 10; 27 28 private INSURLHandler( ) { 29 } 30 31 public synchronized static INSURLHandler getINSURLHandler( ) { 32 if( insURLHandler == null ) { 33 insURLHandler = new INSURLHandler( ); 34 } 35 return insURLHandler; 36 } 37 38 public INSURL parseURL( String aUrl ) { 39 String url = aUrl; 40 if ( url.startsWith( "corbaloc:" ) == true ) { 41 return new CorbalocURL( url.substring( CORBALOC_PREFIX_LENGTH ) ); 42 } else if ( url.startsWith ( "corbaname:" ) == true ) { 43 return new CorbanameURL( url.substring( CORBANAME_PREFIX_LENGTH ) ); 44 } 45 return null; 46 } 47 } 48 | Popular Tags |