angular 2: tool-kit for building angular 2 web app

Personale collezione di link utili:

  • angular 2 house
    • One framework. Mobile and desktop.
    • https://angular.io
  • webpack starter kit
    • An Angular 2 Starter kit featuring Angular 2 (Router, Http, Forms, Services, Tests, E2E), Karma, Protractor, Jasmine, TypeScript, and Webpack by @AngularClass
    • https://angularclass.github.io/angular2-webpack-starter/
  • primeNG
    • PrimeNG is a collection of rich UI components for AngularJS2. PrimeNG is a sibling of the popular JavaServer Faces Component Suite, PrimeFaces.
    • http://www.primefaces.org/primeng
  • angular 2 ACL
    • An example of how to build an angular 2 directive which takes in an array of roles, and calls a data service to match against what roles a user has. The directive will not render the components/html a user doesn’t have the right roles to access.
    • http://www.unitydatasystems.com/blog/2015/12/08/angular-2-user-permissions/
  • Dynamically Configuring the Angular’s Router
    • How to incrementally load the entire application by only requesting the resources required for the individual views.
    • http://blog.mgechev.com/2015/12/30/angular2-router-dynamic-route-config-definition-creation/
  • Rest annotations to symplify the use of rest resources
    • Angular2 HTTP client to consume RESTful services. Built on angular2/http with TypeScript.
    • https://github.com/Paldom/angular2-rest
  • Lazy loading components routes services router
    •  If you don’t use minification of code, you can lazy load all router components
    • http://blog.mgechev.com/2015/12/30/angular2-router-dynamic-route-config-definition-creation/

ejb3 timer clustered using database (in wildfly10)

Anche in quartz si usa il database per gestire in modo clusterizzato, concorrente, su nodi differenti, i timers. In wildfly, sembra essere possibile (ancora mai provato) persistere i timers su database invece che su filesystem.

Condividendo lo stesso nome della “partition” tra più nodi, sia ha una gestione multi nodo degli stessi timers. Sarà il lock su db a stabilire quale nodo può essere lanciato in esecuzione.

  • in standalone-full.xml, creazione del datasource per i timers  (1)
  • in standalone-full.xml, modifica della sezione timer-service (2)
  • verificare se le query dei timers siano compatibili con il proprio db (3)
  • aggiungere le solite annotazione alla classe:
    • @Singleton
    • @Startup
  • aggiungere annotazione sul metodo da eseguire:
    • @Schedule(hour = "*", minute = "*", second = "*", info ="My timer",persistent=true)
  • oppure usare il timerservice per schedulare nuovi timers:
    • @Resource TimerService timerService;
    • TimerConfig test = new TimerConfig(“test”, true);
    • timerService.createCalendarTimer(new ScheduleExpression().month(5).dayOfMonth(“20-Last”).minute(0).hour(8), test);

Articoli utili:

  • https://docs.jboss.org/author/display/WFLY10/EJB3+Clustered+Database+Timers
  • http://www.mastertheboss.com/jboss-server/wildfly-8/creating-clustered-ejb-3-timers
  • http://docs.oracle.com/javaee/7/api/javax/ejb/TimerService.html
(1)
<datasource jta="true" jndi-name="java:/MySQLDS" pool-name="ms" enabled="true" use-ccm="true">
   <connection-url>jdbc:postgresql://localhost/mysql</connection-url>
   <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
   <driver>mysql</driver>
   <security>
      <user-name>mysql</user-name>
      <password>mysql</password>
   </security>
   <validation>
      <validate-on-match>false</validate-on-match>
      <background-validation>false</background-validation>
   </validation>
   <timeout>
      <set-tx-query-timeout>false</set-tx-query-timeout>
      <blocking-timeout-millis>0</blocking-timeout-millis>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <query-timeout>0</query-timeout>
      <use-try-lock>0</use-try-lock>
      <allocation-retry>0</allocation-retry>
      <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
   </timeout>
   <statement>
      <share-prepared-statements>false</share-prepared-statements>
   </statement>
</datasource>
<drivers>
       <driver name="mysql" module="com.mysql"/>
</drivers>
(2)
eliminare:
<timer-service thread-pool-name=”default” default-data-store=”default-file-store”>
<data-stores>
<file-data-store name=”default-file-store” path=”timer-service-data” relative-to=”jboss.server.data.dir”/>
</data-stores>
</timer-service>
inserire:
<timer-service thread-pool-name="default"default-data-store="clustered-store">
   <data-stores>
        <database-data-storename="clustered-store"datasource-jndi-name="java:/MySQLDS" database="mysql" partition="timer"/>
   </data-stores>
</timer-service>
(3)
wildfly-10.0.0.Final/modules/system/layers/base/org/jboss/as/ejb3/main/timers/
timer-sql.properties

docker links

postegresql: https://hub.docker.com/_/postgres

docker alpine jdk8: https://github.com/anapsix/docker-alpine-java/blob/master/8/jdk/Dockerfile

wildfly+postgresql: https://blog.mikesir87.io/2015/12/creating-wildfly-docker-image-with-postgresql/

https://goldmann.pl/blog/2014/07/23/customizing-the-configuration-of-the-wildfly-docker-image/

postgresql vs mysql – utilities

mysql: SHOW TABLES
postgresql: \d
postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

mysql: SHOW DATABASES
postgresql: \l
postgresql: SELECT datname FROM pg_database;

mysql: SHOW COLUMNS
postgresql: \d table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';

mysql: DESCRIBE TABLE
postgresql: \d+ table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';

[font: http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/]