-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #190 Remove module .xml and use genrated source code injected with
spi
- Loading branch information
Showing
32 changed files
with
396 additions
and
342 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
6 changes: 6 additions & 0 deletions
6
org.jrebirth.af/api/src/main/java/org/jrebirth/af/api/module/ModuleStarter.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,6 @@ | ||
package org.jrebirth.af.api.module; | ||
|
||
public interface ModuleStarter { | ||
|
||
void start(); | ||
} |
8 changes: 8 additions & 0 deletions
8
org.jrebirth.af/api/src/main/java/org/jrebirth/af/api/module/Preloadable.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,8 @@ | ||
package org.jrebirth.af.api.module; | ||
|
||
import org.jrebirth.af.api.annotation.Preload; | ||
|
||
@Preload | ||
public interface Preloadable { | ||
|
||
} |
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
4 changes: 4 additions & 0 deletions
4
org.jrebirth.af/api/src/main/java/org/jrebirth/af/api/module/package-info.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,4 @@ | ||
/** | ||
* Provides... | ||
*/ | ||
package org.jrebirth.af.api.module; |
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
4 changes: 2 additions & 2 deletions
4
.../src/main/java/org/jrebirth/af/component/behavior/dockable/impl/DockableBehaviorImpl.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
2 changes: 1 addition & 1 deletion
2
...component/src/main/java/org/jrebirth/af/component/behavior/swipable/SwipableBehavior.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
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
55 changes: 55 additions & 0 deletions
55
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/module/AbstractModuleStarter.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,55 @@ | ||
package org.jrebirth.af.core.module; | ||
|
||
import org.jrebirth.af.api.command.Command; | ||
import org.jrebirth.af.api.component.basic.Component; | ||
import org.jrebirth.af.api.exception.CoreRuntimeException; | ||
import org.jrebirth.af.api.facade.GlobalFacade; | ||
import org.jrebirth.af.api.module.ModuleStarter; | ||
import org.jrebirth.af.api.service.Service; | ||
import org.jrebirth.af.api.ui.Model; | ||
import org.jrebirth.af.core.concurrent.JRebirthThread; | ||
|
||
public abstract class AbstractModuleStarter implements ModuleStarter { | ||
|
||
protected void register(Class<? extends Component<?>> interfaceClass, Class<? extends Component<?>> implClass) { | ||
getFacade().getComponentFactory().register(interfaceClass, implClass); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
protected void bootComponent(Class<? extends Component<?>> componentClass) { | ||
|
||
preloadClass(componentClass); | ||
|
||
try { | ||
if (Command.class.isAssignableFrom(componentClass)) { | ||
getFacade().getCommandFacade().retrieve((Class<Command>) componentClass); | ||
} else if (Service.class.isAssignableFrom(componentClass)) { | ||
getFacade().getServiceFacade().retrieve((Class<Service>) componentClass); | ||
} else if (Model.class.isAssignableFrom(componentClass)) { | ||
getFacade().getUiFacade().retrieve((Class<Model>) componentClass); | ||
} | ||
} catch (final CoreRuntimeException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
/** | ||
* TODO To complete. | ||
* | ||
* @param objectClass | ||
*/ | ||
protected void preloadClass(Class<?> objectClass) { | ||
try { | ||
Class.forName(objectClass.getName()); | ||
} catch (final ClassNotFoundException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
/** | ||
* TODO To complete. | ||
*/ | ||
protected GlobalFacade getFacade() { | ||
return JRebirthThread.getThread().getFacade(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/module/package-info.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,7 @@ | ||
/** | ||
* The class <strong>package-info</strong>. | ||
* TODO To complete | ||
* | ||
* @author Sébastien Bordes | ||
*/ | ||
package org.jrebirth.af.core.module; |
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.