Delete DataGridFactory
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/21c40ba0 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/21c40ba0 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/21c40ba0 Branch: refs/heads/master Commit: 21c40ba0b9ab2eabe76ce834117964a1613a4677 Parents: 236afd7 Author: Aled Sage <[email protected]> Authored: Wed May 3 20:59:47 2017 +0100 Committer: Aled Sage <[email protected]> Committed: Fri May 5 11:23:51 2017 +0100 ---------------------------------------------------------------------- .../core/internal/storage/DataGridFactory.java | 38 ------------------- .../impl/inmemory/InMemoryDataGridFactory.java | 40 -------------------- .../internal/AbstractManagementContext.java | 4 +- 3 files changed, 2 insertions(+), 80 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/21c40ba0/core/src/main/java/org/apache/brooklyn/core/internal/storage/DataGridFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/internal/storage/DataGridFactory.java b/core/src/main/java/org/apache/brooklyn/core/internal/storage/DataGridFactory.java deleted file mode 100644 index 45c696b..0000000 --- a/core/src/main/java/org/apache/brooklyn/core/internal/storage/DataGridFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.core.internal.storage; - -import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal; - -/** - * A factory for creating a {@link DataGrid}. - * - * Implementations of this interface should have a public no arg constructor; this constructor will be - * called through reflection in the {@link org.apache.brooklyn.core.mgmt.internal.LocalManagementContext}. - */ -public interface DataGridFactory { - - /** - * Creates a {@link BrooklynStorage} instance. - * - * @param managementContext the ManagementContextInternal - * @return the created BrooklynStorage. - */ - DataGrid newDataGrid(ManagementContextInternal managementContext); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/21c40ba0/core/src/main/java/org/apache/brooklyn/core/internal/storage/impl/inmemory/InMemoryDataGridFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/internal/storage/impl/inmemory/InMemoryDataGridFactory.java b/core/src/main/java/org/apache/brooklyn/core/internal/storage/impl/inmemory/InMemoryDataGridFactory.java deleted file mode 100644 index 0ce0aa7..0000000 --- a/core/src/main/java/org/apache/brooklyn/core/internal/storage/impl/inmemory/InMemoryDataGridFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.core.internal.storage.impl.inmemory; - -import org.apache.brooklyn.core.internal.storage.DataGrid; -import org.apache.brooklyn.core.internal.storage.DataGridFactory; -import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal; - -public class InMemoryDataGridFactory implements DataGridFactory { - - public static DataGridFactory ofInstance(final DataGrid datagrid) { - return new DataGridFactory() { - @Override - public DataGrid newDataGrid(ManagementContextInternal managementContext) { - return datagrid; - } - }; - } - - @Override - public DataGrid newDataGrid(ManagementContextInternal managementContext) { - return new InmemoryDatagrid(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/21c40ba0/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java index 193f328..45a45d7 100644 --- a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java +++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java @@ -61,7 +61,7 @@ import org.apache.brooklyn.core.entity.drivers.downloads.BasicDownloadsManager; import org.apache.brooklyn.core.internal.BrooklynProperties; import org.apache.brooklyn.core.internal.storage.BrooklynStorage; import org.apache.brooklyn.core.internal.storage.impl.BrooklynStorageImpl; -import org.apache.brooklyn.core.internal.storage.impl.inmemory.InMemoryDataGridFactory; +import org.apache.brooklyn.core.internal.storage.impl.inmemory.InmemoryDatagrid; import org.apache.brooklyn.core.location.BasicLocationRegistry; import org.apache.brooklyn.core.mgmt.BrooklynTaskTags; import org.apache.brooklyn.core.mgmt.classloading.BrooklynClassLoadingContextSequential; @@ -169,7 +169,7 @@ public abstract class AbstractManagementContext implements ManagementContextInte this.catalog = new BasicBrooklynCatalog(this); this.typeRegistry = new BasicBrooklynTypeRegistry(this); - this.storage = new BrooklynStorageImpl(new InMemoryDataGridFactory().newDataGrid(this)); + this.storage = new BrooklynStorageImpl(new InmemoryDatagrid()); this.rebindManager = new RebindManagerImpl(this); // TODO leaking "this" reference; yuck this.highAvailabilityManager = new HighAvailabilityManagerImpl(this); // TODO leaking "this" reference; yuck
