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