Commit 1b9a09a5 authored by Menghan Li's avatar Menghan Li
Browse files

Moved the XMLPersistenceProvider.getJAXBProviders()operation.



I moved this operation to be a static interface operation on
IJAXBClassProvider, which will remove the requirements for the
XMLPersistenceProvider
Signed-off-by: default avatarMenghan Li <menghanli723@gmail.com>
parent 001f87dc
No preview for this file type
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: org.eclipse.ice.reactor.sfr.native.test
# Tool invocations
org.eclipse.ice.reactor.sfr.native.test: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -o "org.eclipse.ice.reactor.sfr.native.test" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) org.eclipse.ice.reactor.sfr.native.test
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
C_UPPER_SRCS :=
CXX_SRCS :=
C++_SRCS :=
OBJ_SRCS :=
CC_SRCS :=
ASM_SRCS :=
CPP_SRCS :=
C_SRCS :=
O_SRCS :=
S_UPPER_SRCS :=
CC_DEPS :=
C++_DEPS :=
EXECUTABLES :=
C_UPPER_DEPS :=
CXX_DEPS :=
OBJS :=
CPP_DEPS :=
C_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../FeatureSetTester.cpp \
../GridDataManagerTester.cpp \
../GridManagerTester.cpp \
../MaterialBlockTester.cpp \
../MaterialTester.cpp \
../PinAssemblyTester.cpp \
../ReflectorAssemblyTester.cpp \
../RingTester.cpp \
../SFRAssemblyTester.cpp \
../SFRComponentTester.cpp \
../SFRCompositeTester.cpp \
../SFRDataTester.cpp \
../SFRPinTester.cpp \
../SFRRodTester.cpp \
../SFReactorIOHandlerTester.cpp \
../SFReactorTester.cpp
OBJS += \
./FeatureSetTester.o \
./GridDataManagerTester.o \
./GridManagerTester.o \
./MaterialBlockTester.o \
./MaterialTester.o \
./PinAssemblyTester.o \
./ReflectorAssemblyTester.o \
./RingTester.o \
./SFRAssemblyTester.o \
./SFRComponentTester.o \
./SFRCompositeTester.o \
./SFRDataTester.o \
./SFRPinTester.o \
./SFRRodTester.o \
./SFReactorIOHandlerTester.o \
./SFReactorTester.o
CPP_DEPS += \
./FeatureSetTester.d \
./GridDataManagerTester.d \
./GridManagerTester.d \
./MaterialBlockTester.d \
./MaterialTester.d \
./PinAssemblyTester.d \
./ReflectorAssemblyTester.d \
./RingTester.d \
./SFRAssemblyTester.d \
./SFRComponentTester.d \
./SFRCompositeTester.d \
./SFRDataTester.d \
./SFRPinTester.d \
./SFRRodTester.d \
./SFReactorIOHandlerTester.d \
./SFReactorTester.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../assembly/PinAssembly.cpp \
../assembly/ReflectorAssembly.cpp \
../assembly/Ring.cpp \
../assembly/SFRAssembly.cpp \
../assembly/SFRPin.cpp \
../assembly/SFRRod.cpp
OBJS += \
./assembly/PinAssembly.o \
./assembly/ReflectorAssembly.o \
./assembly/Ring.o \
./assembly/SFRAssembly.o \
./assembly/SFRPin.o \
./assembly/SFRRod.o
CPP_DEPS += \
./assembly/PinAssembly.d \
./assembly/ReflectorAssembly.d \
./assembly/Ring.d \
./assembly/SFRAssembly.d \
./assembly/SFRPin.d \
./assembly/SFRRod.d
# Each subdirectory must supply rules for building sources it contributes
assembly/%.o: ../assembly/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include assembly/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: org.eclipse.ice.reactor.sfr.native
# Tool invocations
org.eclipse.ice.reactor.sfr.native: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -o "org.eclipse.ice.reactor.sfr.native" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) org.eclipse.ice.reactor.sfr.native
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
C_UPPER_SRCS :=
CXX_SRCS :=
C++_SRCS :=
OBJ_SRCS :=
CC_SRCS :=
ASM_SRCS :=
CPP_SRCS :=
C_SRCS :=
O_SRCS :=
S_UPPER_SRCS :=
CC_DEPS :=
C++_DEPS :=
EXECUTABLES :=
C_UPPER_DEPS :=
CXX_DEPS :=
OBJS :=
CPP_DEPS :=
C_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
assembly \
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../FeatureSet.cpp \
../GridDataManager.cpp \
../GridManager.cpp \
../Material.cpp \
../MaterialBlock.cpp \
../SFRComponent.cpp \
../SFRComposite.cpp \
../SFRData.cpp \
../SFReactor.cpp \
../SFReactorFactory.cpp \
../SFReactorIOHandler.cpp \
../UtilityOperations.cpp
OBJS += \
./FeatureSet.o \
./GridDataManager.o \
./GridManager.o \
./Material.o \
./MaterialBlock.o \
./SFRComponent.o \
./SFRComposite.o \
./SFRData.o \
./SFReactor.o \
./SFReactorFactory.o \
./SFReactorIOHandler.o \
./UtilityOperations.o
CPP_DEPS += \
./FeatureSet.d \
./GridDataManager.d \
./GridManager.d \
./Material.d \
./MaterialBlock.d \
./SFRComponent.d \
./SFRComposite.d \
./SFRData.d \
./SFReactor.d \
./SFReactorFactory.d \
./SFReactorIOHandler.d \
./UtilityOperations.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
......@@ -52,6 +52,7 @@ import org.eclipse.ice.datastructures.form.FormStatus;
import org.eclipse.ice.io.serializable.IIOService;
import org.eclipse.ice.item.ICompositeItemBuilder;
import org.eclipse.ice.item.ItemBuilder;
import org.eclipse.ice.item.Registry;
import org.eclipse.ice.item.SerializedItemBuilder;
import org.eclipse.ice.item.messaging.Message;
import org.eclipse.ice.item.persistence.IPersistenceProvider;
......@@ -262,8 +263,15 @@ public class Core extends Application implements ICore, BundleActivator {
// load items.
itemManager.setPersistenceProvider(provider);
}
// Load up the ItemBuilders
ItemBuilder [] builders = ItemBuilder.getItemBuilders();
for (ItemBuilder builder : builders) {
registerItem(builder);
}
/** to delete later
ItemBuilder builder = null;
IExtensionPoint point = Platform.getExtensionRegistry()
.getExtensionPoint(builderID);
......@@ -281,6 +289,7 @@ public class Core extends Application implements ICore, BundleActivator {
} else {
logger.error("Extension Point " + builderID + "does not exist");
}
**/
// Tell the ItemManager to suit up. It's time to rock and roll.
itemManager.loadItems(itemDBProject);
......
......@@ -8,6 +8,7 @@ Require-Bundle: org.junit;bundle-version="4.8.2",
Import-Package: ca.odell.glazedlists,
ca.odell.glazedlists.event,
ca.odell.glazedlists.gui,
org.eclipse.core.runtime;version="3.5.0",
org.eclipse.emf.common.util,
org.eclipse.emf.ecore.xmi,
org.eclipse.emf.ecore.xmi.impl,
......
/*******************************************************************************
* Copyright (c) 2013, 2014- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.datastructures.test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.datastructures.jaxbclassprovider.IJAXBClassProvider;
import org.junit.Test;
/**
* This class tests the static interface operation
* ItemBuilder.getItemBuilders().
*
* @author Jay Jay Billings
*
*/
public class IJAXBClassProviderTester {
/**
* Test for {@link org.eclipse.ice.item.ItemBuilder}.
*
* @throws CoreException
*/
@Test
public void test() throws CoreException {
// Simply get the builders from the registry and make sure they are
// actually there.
IJAXBClassProvider[] providers = IJAXBClassProvider.getJAXBProviders();
assertNotNull(providers);
assertTrue(providers.length > 0);
return;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
......
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.8
......@@ -17,6 +17,7 @@ Export-Package: org.eclipse.ice.datastructures.ICEObject,
org.eclipse.ice.datastructures.resource
Import-Package: ca.odell.glazedlists,
ca.odell.glazedlists.event,
org.eclipse.core.runtime;version="3.5.0",
org.eclipse.emf.common,
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
......
......@@ -14,6 +14,13 @@ package org.eclipse.ice.datastructures.jaxbclassprovider;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The IJAXBClassProvider interface provides the methods necessary to inform
* clients creating a JAXBContext object of the relevant classes that must be
......@@ -44,5 +51,43 @@ public interface IJAXBClassProvider {
* @return providerName The name of this IJAXBClassProvider
*/
public String getProviderName();
/**
* This operation pulls the list of JAXB class providers from the registry
* for classes that need custom handling.
*
* @return The list of class providers.
* @throws CoreException
*/
public static IJAXBClassProvider[] getJAXBProviders() throws CoreException {
/**
* Logger for handling event messages and other information.
*/
Logger logger = LoggerFactory.getLogger(IJAXBClassProvider.class);
IJAXBClassProvider[] jaxbProviders = null;
String id = "org.eclipse.ice.item.itemBuilder";
IExtensionPoint point = Platform.getExtensionRegistry()
.getExtensionPoint(id);
// If the point is available, create all the builders and load them into
// the array.
if (point != null) {
IConfigurationElement[] elements = point.getConfigurationElements();
jaxbProviders = new IJAXBClassProvider[elements.length];
for (int i = 0; i < elements.length; i++) {
jaxbProviders[i] = (IJAXBClassProvider) elements[i]
.createExecutableExtension("class");
}
} else {
logger.error("Extension Point " + id + "does not exist");
}
return jaxbProviders;
}
}
......@@ -85,34 +85,5 @@ public class XMLPersistenceExtensionFactory
return provider;
}
/**
* This operation pulls the list of JAXB class providers from the registry
* for classes that need custom handling.
*
* @return The list of class providers.
* @throws CoreException
*/
private IJAXBClassProvider[] getJAXBProviders() throws CoreException {
IJAXBClassProvider[] jaxbProviders = null;
String id = "org.eclipse.ice.item.itemBuilder";
IExtensionPoint point = Platform.getExtensionRegistry()
.getExtensionPoint(id);
// If the point is available, create all the builders and load them into
// the array.
if (point != null) {
IConfigurationElement[] elements = point.getConfigurationElements();
jaxbProviders = new IJAXBClassProvider[elements.length];
for (int i = 0; i < elements.length; i++) {
jaxbProviders[i] = (IJAXBClassProvider) elements[i]
.createExecutableExtension("class");
}
} else {
logger.error("Extension Point " + id + "does not exist");
}
return jaxbProviders;
}
}
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk