View Javadoc

1   /*
2    * $Id: DefaultRegistryBroker.java 21528 2011-03-10 16:00:09Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.registry;
12  
13  import org.mule.api.MuleContext;
14  import org.mule.api.registry.Registry;
15  
16  import java.util.ArrayList;
17  import java.util.Collection;
18  import java.util.List;
19  
20  public class DefaultRegistryBroker extends AbstractRegistryBroker
21  {
22      private TransientRegistry transientRegistry;
23      private List<Registry> registries = new ArrayList<Registry>();
24  
25      public DefaultRegistryBroker(MuleContext context)
26      {
27          super(context);
28          transientRegistry = new TransientRegistry(context);
29          registries.add(0, transientRegistry);
30      }
31  
32      TransientRegistry getTransientRegistry()
33      {
34          return transientRegistry;
35      }
36  
37      public void addRegistry(Registry registry)
38      {
39          registries.add(1, registry);
40      }
41  
42      public void removeRegistry(Registry registry)
43      {
44          registries.remove(registry);
45      }
46  
47      protected Collection<Registry> getRegistries()
48      {
49          return registries;
50      }
51  }