Coverage Report - org.codehaus.classworlds.ConfiguratorAdapter
 
Classes in this File Line Coverage Branch Coverage Complexity
ConfiguratorAdapter
0 %
0/21
N/A
2
 
 1  
 package org.codehaus.classworlds;
 2  
 
 3  
 /*
 4  
  * Copyright 2001-2010 Codehaus Foundation.
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *      http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 import java.io.InputStream;
 20  
 import java.io.IOException;
 21  
 import java.net.MalformedURLException;
 22  
 
 23  
 /**
 24  
  * Created by IntelliJ IDEA.
 25  
  *
 26  
  * @uthor: Andrew Williams
 27  
  * @since: Nov 25, 2006
 28  
  */
 29  
 @Deprecated
 30  
 public class ConfiguratorAdapter
 31  
     extends Configurator
 32  
 {
 33  
 
 34  
     public static ConfiguratorAdapter getInstance( org.codehaus.plexus.classworlds.launcher.Configurator newConfig,
 35  
                                                    Launcher launcher )
 36  
     {
 37  0
         ConfiguratorAdapter adapter = new ConfiguratorAdapter( newConfig, launcher );
 38  
 
 39  0
         return adapter;
 40  
     }
 41  
 
 42  
     public static ConfiguratorAdapter getInstance( org.codehaus.plexus.classworlds.launcher.Configurator newConfig,
 43  
                                                    ClassWorld world )
 44  
     {
 45  0
         ConfiguratorAdapter adapter = new ConfiguratorAdapter( newConfig, world );
 46  
 
 47  0
         return adapter;
 48  
     }
 49  
 
 50  
     private org.codehaus.plexus.classworlds.launcher.Configurator config;
 51  
 
 52  
     private ConfiguratorAdapter( org.codehaus.plexus.classworlds.launcher.Configurator config, Launcher launcher )
 53  
     {
 54  0
         super( launcher );
 55  0
         this.config = config;
 56  0
     }
 57  
 
 58  
     private ConfiguratorAdapter( org.codehaus.plexus.classworlds.launcher.Configurator config, ClassWorld world )
 59  
     {
 60  0
         super( world );
 61  0
         this.config = config;
 62  0
     }
 63  
 
 64  
     public void associateRealms()
 65  
     {
 66  0
         config.associateRealms();
 67  0
     }
 68  
 
 69  
     public void configureAdapter( InputStream is )
 70  
         throws IOException, MalformedURLException, ConfigurationException, DuplicateRealmException, NoSuchRealmException
 71  
     {
 72  
         try
 73  
         {
 74  0
             config.configure( is );
 75  
         }
 76  0
         catch ( org.codehaus.plexus.classworlds.launcher.ConfigurationException e )
 77  
         {
 78  0
             throw new ConfigurationException( e.getMessage() );
 79  
         }
 80  0
         catch ( org.codehaus.plexus.classworlds.realm.DuplicateRealmException e )
 81  
         {
 82  0
             throw new DuplicateRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() );
 83  
         }
 84  0
         catch ( org.codehaus.plexus.classworlds.realm.NoSuchRealmException e )
 85  
         {
 86  0
             throw new NoSuchRealmException( ClassWorldAdapter.getInstance( e.getWorld() ), e.getId() );
 87  0
         }
 88  0
     }
 89  
 
 90  
 }