Browse Source

Merge branch 'feature/10.0' of http://cloud.finedevelop.com:2015/scm/~kerry/base-third into feature/10.0

research/11.0
kerry 6 years ago
parent
commit
7e5de3f688
  1. 4
      build.third_step0.gradle
  2. 2
      build.third_step1.gradle
  3. 2
      build.third_step2.gradle
  4. 2
      build.third_step3.gradle
  5. 2
      build.third_step4.gradle
  6. 2
      build.third_step5.gradle
  7. 2
      build.third_step6.gradle
  8. 7
      fine-hibernate/src/com/fr/third/org/hibernate/tuple/PojoInstantiator.java
  9. 40
      fine-hibernate/src/com/fr/third/org/hibernate/tuple/entity/DefaultEntityRegister.java
  10. 11
      fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/ClassFactory.java
  11. 18
      fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/TypeFactory.java

4
build.third_step0.gradle

@ -40,7 +40,7 @@ def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.s
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def srcDir="." def srcDir="."
def maven_version="${version}-RELEASE-SNAPSHOT" def maven_version="${version}-FEATURE-SNAPSHOT"
def jar_version = version def jar_version = version
configurations { configurations {
@ -49,7 +49,7 @@ configurations {
} }
dependencies { dependencies {
thirdjar "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" thirdjar "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
sigar "com.fr.third:sigar:1.6.0" sigar "com.fr.third:sigar:1.6.0"
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step1.gradle

@ -56,7 +56,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-poi/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-poi/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/fine-quartz/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-quartz/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step2.gradle

@ -45,7 +45,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-aspectj/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-aspectj/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/fine-spring/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-spring/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step3.gradle

@ -46,7 +46,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+
dependencies{ dependencies{
compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step4.gradle

@ -45,7 +45,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+
dependencies{ dependencies{
compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step5.gradle

@ -44,7 +44,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'ojdbc7-12.1.0.jar') compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'ojdbc7-12.1.0.jar')
compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

2
build.third_step6.gradle

@ -72,7 +72,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-redisson/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-redisson/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/fine-socketio/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-socketio/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
compile "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" compile "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

7
fine-hibernate/src/com/fr/third/org/hibernate/tuple/PojoInstantiator.java

@ -17,6 +17,7 @@ import com.fr.third.org.hibernate.internal.CoreLogging;
import com.fr.third.org.hibernate.internal.CoreMessageLogger; import com.fr.third.org.hibernate.internal.CoreMessageLogger;
import com.fr.third.org.hibernate.internal.util.ReflectHelper; import com.fr.third.org.hibernate.internal.util.ReflectHelper;
import com.fr.third.org.hibernate.mapping.Component; import com.fr.third.org.hibernate.mapping.Component;
import com.fr.third.org.hibernate.tuple.entity.DefaultEntityRegister;
/** /**
* Defines a POJO-based instantiator for use from the tuplizers. * Defines a POJO-based instantiator for use from the tuplizers.
@ -72,7 +73,11 @@ public class PojoInstantiator implements Instantiator, Serializable {
public Object instantiate() { public Object instantiate() {
if ( isAbstract ) { if ( isAbstract ) {
throw new InstantiationException( "Cannot instantiate abstract class or interface: ", mappedClass ); try {
return DefaultEntityRegister.getInstance().getDefaultEntityClass(mappedClass).newInstance();
} catch (Exception e) {
throw new InstantiationException("class not found: ", mappedClass);
}
} }
else if ( optimizer != null ) { else if ( optimizer != null ) {
return optimizer.newInstance(); return optimizer.newInstance();

40
fine-hibernate/src/com/fr/third/org/hibernate/tuple/entity/DefaultEntityRegister.java

@ -0,0 +1,40 @@
package com.fr.third.org.hibernate.tuple.entity;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by Zed on 2018/11/1.
*/
public class DefaultEntityRegister {
private static volatile DefaultEntityRegister instance;
private static Map<Class, Class> MAP = new ConcurrentHashMap<Class, Class>();
public static DefaultEntityRegister getInstance() {
if (instance == null) {
synchronized (DefaultEntityRegister.class) {
if (instance == null) {
instance = new DefaultEntityRegister();
}
}
}
return instance;
}
private DefaultEntityRegister() {
}
public void registerDefaultClass(Class abstractEntityClass, Class defaultEntityClass) {
MAP.put(abstractEntityClass, defaultEntityClass);
}
public void removeDefaultClass(Class abstractEntityClass) {
MAP.remove(abstractEntityClass);
}
public Class getDefaultEntityClass(Class abstractEntityClass) {
return MAP.get(abstractEntityClass);
}
}

11
fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/ClassFactory.java

@ -0,0 +1,11 @@
package com.fr.third.fasterxml.jackson.databind.type;
/**
* Created by juhaoyu on 2018/11/5.
*/
public interface ClassFactory {
Class<?> classForName(String className) throws ClassNotFoundException;
Class<?> classForName(String className, ClassLoader classLoader) throws ClassNotFoundException;
}

18
fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/TypeFactory.java

@ -103,13 +103,21 @@ public final class TypeFactory
* ClassLoader used by this factory (Issue #624) * ClassLoader used by this factory (Issue #624)
*/ */
protected final ClassLoader _classLoader; protected final ClassLoader _classLoader;
private ClassFactory classFactory;
/* /*
/********************************************************** /**********************************************************
/* Life-cycle /* Life-cycle
/********************************************************** /**********************************************************
*/ */
public void setClassFactory(ClassFactory classFactory) {
this.classFactory = classFactory;
}
private TypeFactory() { private TypeFactory() {
_parser = new TypeParser(this); _parser = new TypeParser(this);
_modifiers = null; _modifiers = null;
@ -247,10 +255,18 @@ public final class TypeFactory
protected Class<?> classForName(String name, boolean initialize, protected Class<?> classForName(String name, boolean initialize,
ClassLoader loader) throws ClassNotFoundException { ClassLoader loader) throws ClassNotFoundException {
if (classFactory != null) {
return classFactory.classForName(name, loader);
}
return Class.forName(name, true, loader); return Class.forName(name, true, loader);
} }
protected Class<?> classForName(String name) throws ClassNotFoundException { protected Class<?> classForName(String name) throws ClassNotFoundException {
if (classFactory != null) {
return classFactory.classForName(name);
}
return Class.forName(name); return Class.forName(name);
} }

Loading…
Cancel
Save