01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.lib.client.commands;
15:
16: import org.jetbrains.annotations.NotNull;
17:
18: import java.util.HashMap;
19:
20: /**
21: * User: Martin
22: * Date: 23.11.2004
23: * Time: 19:39:50
24: */
25: public class CommandRegistryManager {
26: @NotNull
27: private HashMap<Long, ApplicationCommandRegistry> commandRegistries;
28:
29: public CommandRegistryManager() {
30: this .commandRegistries = new HashMap<Long, ApplicationCommandRegistry>();
31: }
32:
33: @NotNull
34: public ApplicationCommandRegistry getApplicationCommandRegistry(
35: @NotNull
36: Long applicationId) {
37: ApplicationCommandRegistry commandRegistry = commandRegistries
38: .get(applicationId);
39: if (commandRegistry == null) {
40: commandRegistry = new ApplicationCommandRegistry(
41: applicationId);
42: commandRegistries.put(applicationId, commandRegistry);
43: }
44:
45: return commandRegistry;
46: }
47:
48: }
|