Skip to content

Commit

Permalink
# sprint-2 minor
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Feb 17, 2015
1 parent 68a3b77 commit 2f7d2ad
Showing 1 changed file with 2 additions and 20 deletions.
Expand Up @@ -3003,25 +3003,15 @@ private static <T extends GridComponent> T createComponent(Class<T> cls, GridKer
if (comp != null)
return comp;

// TODO 9341: get rid of ent/os after moving ent code to plugin.
Class<T> implCls = null;

try {
implCls = (Class<T>)Class.forName(enterpriseClassName(cls));
implCls = (Class<T>)Class.forName(componentClassName(cls));
}
catch (ClassNotFoundException ignore) {
// No-op.
}

if (implCls == null) {
try {
implCls = (Class<T>)Class.forName(openSourceClassName(cls));
}
catch (ClassNotFoundException ignore) {
// No-op.
}
}

if (implCls == null)
throw new IgniteCheckedException("Failed to find component implementation: " + cls.getName());

Expand All @@ -3047,19 +3037,11 @@ private static <T extends GridComponent> T createComponent(Class<T> cls, GridKer
}
}

/**
* @param cls Component interface.
* @return Name of component implementation class for enterprise edition.
*/
private static String enterpriseClassName(Class<?> cls) {
return cls.getPackage().getName() + ".ent." + cls.getSimpleName().replace("Grid", "GridEnt");
}

/**
* @param cls Component interface.
* @return Name of component implementation class for open source edition.
*/
private static String openSourceClassName(Class<?> cls) {
private static String componentClassName(Class<?> cls) {
return cls.getPackage().getName() + ".os." + cls.getSimpleName().replace("Grid", "GridOs");
}

Expand Down

0 comments on commit 2f7d2ad

Please sign in to comment.