Skip to content

Latest commit

 

History

History
110 lines (70 loc) · 4.16 KB

README.md

File metadata and controls

110 lines (70 loc) · 4.16 KB

FlexiCore Build StatusMaven CentralMaven Central

For comprehensive information about FlexiCore please visit our site.

FlexiCore boosts Spring Boot applications with a very flexible and powerful plugins support, robust access control and an optional set of services many applications require.

Use Case

PersonService in person-service jar

@PluginInfo(version = 1)  
@Extension  
@Component
public class PersonService implements ServicePlugin {  

  private static final Logger logger=LoggerHandler.getLogger(PersonService.class);  
  
 @Autowired  
 @PluginInfo(version = 1)  
  private PersonRepository repository;  
  
  
 public Person createPerson(PersonCreate personCreate, SecurityContext securityContext) {  
        Person person = createPersonNoMerge(personCreate, securityContext);  
  repository.merge(person);  
  return person;  
   }  



public Person createPersonNoMerge(PersonCreate personCreate, SecurityContext securityContext) {  
    Person person = new Person(personCreate.getFirstName(),securityContext);  
    updatePersonNoMerge(person, personCreate); 
     return person;  
     }

AuthorService in library-service jar

@PluginInfo(version = 1)  
@Extension  
@Component  
public class AuthorService implements ServicePlugin {  
  
  @PluginInfo(version = 1)  
  @Autowired  
  private AuthorRepository repository;  
  @Autowired  
  private Logger logger;  
  
  @PluginInfo(version = 1)  
   @Autowired  
  private PersonService personService;  
  
 public Author createAuthor(AuthorCreate authorCreate,  
  SecurityContext securityContext) {  
      Author author = createAuthorNoMerge(authorCreate, securityContext);  
  repository.merge(author);  
 return author;  
  }  
  
   public Author createAuthorNoMerge(AuthorCreate authorCreate,  
  SecurityContext securityContext) {  
      Author author = new Author(authorCreate.getFirstName(),  
  securityContext);  
  updateAuthorNoMerge(author, authorCreate);  
 return author;  
  }

The first code snippet shows a PersonService plugin managing a person CRUD (only create is shown) . the second code sinppet shows an AuthorService plugin managing authors which is dependent on PersonService . both plugins are compiled separately. use by placing both of them in the FlexiCore plugin directory

Debugging Plugins

add the relevant debuggin line to your java properties for java 11: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8787

for java 8: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787

now from your IDE connect to the port specified in the above command (8787)

Documentation

FlexiCore maintains a reference documentation

Docker

if your machine is running docker ( if not installation instructions are available in docker documentation site ) simply run:

docker run -p 8080:8080 wizzdi/flexicore

once initialization is complete a swagger will be avilable at http://:8080/FlexiCore the default username is admin@flexicore.com the password is randomlly generated and can be found in the docker container at /home/flexicore/firstRun.txt docker image is available at Docker Hub

Stay in Touch

Contact us at our site

Main 3rd Party Dependencies

Spring Boot

Pf4J