-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Updated quarkus version to 3.1.3.Final + Added generation time on playgroud quarkus + Added lombok dependency + Added API for AOT type handlers initialization (especially useful for libraries like apache fop)
- Loading branch information
Showing
29 changed files
with
176 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
fj-doc-base/src/main/java/org/fugerit/java/doc/base/config/InitHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.fugerit.java.doc.base.config; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.InputStreamReader; | ||
|
||
import org.fugerit.java.core.cfg.ConfigException; | ||
import org.fugerit.java.core.lang.helpers.ClassHelper; | ||
import org.fugerit.java.core.util.checkpoint.CheckpointUtils; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
* DocTypeHandler Initializer. | ||
* If AOT initialization is needed it is possible to call these Facade. | ||
* | ||
*/ | ||
@Slf4j | ||
public class InitHandler { | ||
|
||
public static final String PATH_INIT_DOC = "config/init_doc/doc-init.xml"; | ||
|
||
public static boolean initDoc( DocTypeHandler handler ) throws ConfigException { | ||
boolean init = true; | ||
long startTime = System.currentTimeMillis(); | ||
try ( InputStreamReader reader = new InputStreamReader( ClassHelper.loadFromDefaultClassLoader( PATH_INIT_DOC ) ); | ||
ByteArrayOutputStream baos = new ByteArrayOutputStream() ) { | ||
handler.handle( DocInput.newInput( handler.getType() , reader ) , DocOutput.newOutput( baos ) ); | ||
log.info( "Init handler time {} -> {}", handler, CheckpointUtils.formatTimeDiffMillis( startTime , System.currentTimeMillis() ) ); | ||
} catch (Exception e) { | ||
throw new ConfigException( "Init exception : "+e, e ); | ||
} | ||
return init; | ||
} | ||
|
||
public static void initDocAsync( DocTypeHandler handler ) { | ||
Runnable runInitDoc = new Runnable() { | ||
@Override | ||
public void run() { | ||
log.info( "Init handler start : {}", handler ); | ||
try { | ||
boolean initOk = initDoc(handler); | ||
log.info( "Init handler end : {} -> {}", handler, initOk ); | ||
} catch (ConfigException e) { | ||
log.info( "Init handler error "+e, e ); | ||
} | ||
} | ||
}; | ||
Thread t = new Thread( runInitDoc ); | ||
t.start(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
fj-doc-base/src/main/resources/config/init_doc/doc-init.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version = "1.0" encoding = "UTF-8" standalone = "no" ?> | ||
<doc | ||
xmlns="http://javacoredoc.fugerit.org" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://javacoredoc.fugerit.org http://www.fugerit.org/data/java/doc/xsd/doc-2-0.xsd" > | ||
|
||
<metadata> | ||
<info name="margins">10;10;10;10</info> | ||
<info name="doc-title">Test XML 01 title</info> | ||
<info name="doc-subject">Test XML 01 subject</info> | ||
<info name="doc-author">Fugerit</info> | ||
<info name="doc-creator">fj-doc (Venus) Sample</info> | ||
<info name="doc-language">en</info> | ||
<bookmark-tree> | ||
<bookmark ref="b1">Bookmark 1</bookmark> | ||
<bookmark ref="b2">Bookmark 2</bookmark> | ||
</bookmark-tree> | ||
</metadata> | ||
<body> | ||
<h head-level="1" align="center" id="b1">Header 1</h> | ||
</body> | ||
</doc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
fj-doc-mod-fop/src/main/java/org/fugerit/java/doc/mod/fop/InitFopHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.fugerit.java.doc.mod.fop; | ||
|
||
import org.fugerit.java.core.cfg.ConfigException; | ||
import org.fugerit.java.doc.base.config.InitHandler; | ||
|
||
/** | ||
* PdfFopTypeHandler Initializer based on a base configuration. | ||
* If AOT initialization is needed it is possible to call these Facade. | ||
* | ||
*/ | ||
public class InitFopHandler { | ||
|
||
public static final PdfFopTypeHandler HANDLER = new PdfFopTypeHandler(); | ||
|
||
public static boolean initDoc() throws ConfigException { | ||
return InitHandler.initDoc( HANDLER ); | ||
} | ||
|
||
public static void initDocAsync() { | ||
InitHandler.initDocAsync( HANDLER ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ayground-quarkus/src/main/java/org/fugerit/java/doc/playground/config/InitPlayground.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.fugerit.java.doc.playground.config; | ||
|
||
import org.fugerit.java.doc.base.config.InitHandler; | ||
import org.fugerit.java.doc.mod.fop.PdfFopTypeHandler; | ||
|
||
import io.quarkus.runtime.StartupEvent; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.event.Observes; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@ApplicationScoped | ||
public class InitPlayground { | ||
|
||
public static final PdfFopTypeHandler PDF_FOP_TYPE_HANDLER = new PdfFopTypeHandler(); | ||
|
||
void onStart(@Observes StartupEvent ev) { | ||
log.info( "InitPlayground start" ); | ||
InitHandler.initDocAsync( PDF_FOP_TYPE_HANDLER ); | ||
log.info( "InitPlayground end" ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.