Friday, December 4, 2009

Enable Syntax Highlighter on JRoller

Howto to enable syntax Highlighter on jroller with alex gorbatchev code syntax Highlighter

1)Preferences->Templates->Weblog->Edit
Put at the end of the template, your preferred list of "brushes" like java, xml scala and others.

after import the gorbatchev css













Note:2.1.364 is latest version, feel free to change version

2)Go to Preferences->Formatting
Uncheck Convert Line Breaks and Emoticons

3)When create an entry (with simple text editor), go to plugin to apply at the end of the page
and unchecked Convert Line Breaks and Emoticons

That's all.
Happy coding.

Spring Aspect Oriented Programming Errata

Right Versions

Before Advice pag 146


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">















BankAccountAspect pag. 165
package org.springaop.chapter.five.concurrent;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import org.apache.log4j.Logger;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springaop.utils.Constants;

@Aspect
public class BankAccountAspect {

@Pointcut("execution(* org.springaop.chapter.five.concurrent.BankAccount.getBalance())")
public void safeRead() {}

@Pointcut("execution(* org.springaop.chapter.five.concurrent.BankAccount.creditOperation(*,*)) ")
public void stateModificationCredit() {}

@Pointcut("execution(* org.springaop.chapter.five.concurrent.BankAccount.debitOperation(*,*)) ")
public void stateModificationDebit() {}

@Pointcut("execution(* org.springaop.chapter.five.concurrent.BankAccount.getId())")
public void getId() {}

@Pointcut("execution(* org.springaop.chapter.five.concurrent.BankAccount.getStartDate())")
public void getStartDate() {}

@Before("safeRead()")
public void beforeSafeRead() {
if (log.isInfoEnabled()) {
log.info("setReadLock");
}
rLock.lock();
}

@After("safeRead()")
public void afterSafeRead() {
rLock.unlock();
if (log.isInfoEnabled()) {
log.info("releaseReadLock");
}
}

@Before("stateModificationCredit() || stateModificationDebit()")
public void beforeSafeWrite() {
if (log.isInfoEnabled()) {
log.info("setWriteLock");
}
wLock.lock();
}

@After("stateModificationCredit() || stateModificationDebit()")
public void afterSafeWrite() {
wLock.unlock();
if (log.isInfoEnabled()) {
log.info("releaseWriteLock");
}
}

private final ReadWriteLock lock = new ReentrantReadWriteLock();
private final Lock rLock = lock.readLock();
private final Lock wLock = lock.writeLock();
private Logger log = Logger.getLogger(Constants.LOG_NAME);
}


BankAccount pg. 167

package org.springaop.chapter.five.concurrent;

import java.util.Date;

import org.apache.log4j.Logger;
import org.springaop.utils.Constants;

public class BankAccount {

public BankAccount(){
this.id = 0;
this.balance = new Float(0);
this.startDate = new Date();
}

public BankAccount(Integer id) {
this.id = id;
this.balance = new Float(0);
this.startDate = new Date();
}

public BankAccount(Integer id, Float balance) {
this.id = id;
this.balance = balance;
this.startDate = new Date();
}

public BankAccount(Integer id, Float balance, Date start) {
this.id = id;
this.balance = balance;
this.startDate = start;
}

public boolean debitOperation(Float debit, Float balance) {
if (balance < debit) {
return false;
} else {
setBalance(balance - debit);
return true;
}
}

public void creditOperation(Float credit, Float balance) {
setBalance(balance+ credit);
}


private void setBalance(Float balance) {
if (log.isInfoEnabled()) {
log.info("setBalance");
}
this.balance = balance;
}

public Float getBalance() {
if (log.isInfoEnabled()) {
log.info(balance);
}
return balance;
}

public Integer getId() {
return id;
}

public Date getStartDate() {
return (Date) startDate.clone();
}

private Float balance;
private final Integer id;
private final Date startDate;
private Logger log = Logger.getLogger(Constants.LOG_NAME);
}

Tuesday, October 20, 2009

Tuesday, October 6, 2009

Roma SpringFramework Meeting October

The SpringFramework Italian User Group with JugRoma and Facoltà di Ingegneria – Università Roma TRE, are proud to announce the meeting with followings arguments:

- Spring JCR Extension: the easiest way to use a Java content repository
– Spring LDAP
– Spring and Adobe Flex
– Non conventional Android Programming
– Scala language first steps
– MongoDB and Scala language
– Scale your database and be happy
– LambdaJ 2.0

Details

Tuesday, September 22, 2009

SpringFramework september Meeting Slides and Photos

Slides and photos of the Spring Italian User Group Meeting , 12 September 2009 in Cagliari.

Slides:MongoDB, OSGi, Flex

Photos

Thursday, August 27, 2009

SpringFramework Italian Meeting - September 2009

Fifth Meeting 12 September 2009 in Cagliari:

http://www.jugsardegna.org/vqwiki/jsp/Wiki?12settembre2009

Speakers-abstract:

Filippo Diotalevi Knokode Ltd : Spring Dynamic Modules: OSGi meets the Spring Framework

OSGi è una delle tecnologie più utilizzate dagli sviluppatori di tutto il mondo, per quanto sia (relativamente) poco conosciuta. E' infatti l'architettura a componenti che sta alla base di Eclipse, di Glassfish, e di altri application server open source e commerciali. L'attenzione dell'OSGi Alliance si sta ora spostando sulle applicazioni enterprise, nel tentativo di mettere a disposizione di tutti gli sviluppatori gli strumenti per sviluppare applicazioni modulari ed orientate ai servizi con OSGi. Questa presentazione vuole introdurre Spring Dynamic Modules (DM), l'estensione allo Spring Framework che consente di eseguire applicazioni Spring all'interno di un framework OSGi, sfruttandone appieno le potenzialità.

Marcello Teodori JugMilano Excogitanet : Spring & Flex

Una panoramica sulle diverse possibilità offerte da Spring per applicazioni RIA realizzate in Flex: Spring sul server per l'implementazione di un backend con serializzazione nativa AMF3 con Spring BlazeDS integration, Spring sul client con Spring Action Script e Spring come usato dallo streaming server opensource Red5 per la realizzazione di applicazioni video.

Massimiliano Dessì JugSardegna ProNetics : MongoDB

Questa presentazione introduce MongoDB un database ad alte prestazioni, schema-free e document-oriented, Open Source.
Vedremo dove si colloca un Document Database tra le varie alternative NOSQL quali Distributed key-value, BigTable, Graph database. Vedremo sopratutto come si usa e in quali casi è da preferire ad un RDBMS.

Monday, July 6, 2009

SpringFramework Meeting 2009 Photos

Alfe Arendsen SpringSource Jteam

Mr. Alef Arendsen, SpringSource JTeam "Springframework 3.0"

Luca Marrocco Exmachina 

Mr. Luca Marrocco, Exmachina "Google App Engine"

Massimiliano Dessì Pronetics Sourcesense

Mr. Massimiliano Dessì, Pronetics Sourcesense "The hidden gems of SpringSecurity"

Mario Fusco Exmachina

Mr. Mario Fusco, Exmachina "Lambdaj"

Piergiorgio Lucidi

Mr. Piergiorgio Lucidi, Sourcesense "A success story: Spring in Alfresco ECM"


Spring Meeting Cagliari Slides and Photos

Slides and photos of the Spring Italian User Group Meeting , 27 June 2009 in Cagliari

Slides

Photos

Wednesday, July 1, 2009

ROO

Friday, June 12, 2009

SpringFramework Italian Meeting 2009

Fourth edition 27 June Cagliari:
http://www.jugsardegna.org/vqwiki/jsp/Wiki?27Giugno2009

Speakers-abstract

Alef Arendsen "Spring 3.0"

Spring 3.0 brings yet another powerful set of new features in the Spring Framework that helps you simplify your code bases a lot more and helps you focus more on the domain problem.
In this talk, Alef Arendsen will highlight what these new features are and showcase them using code examples and demoes. The most important ones are the introduction of the expression language, a completely Java-based configuration option and the support for RESTful resources.


Luca Marrocco "GAEj Google App Engine for Java"

Abstract: Another actor in cloud computing is available for java developer.
Already available for python guys throught django and other nice framework. Starting few month ago Google has release new java environment for its cloud computing services: Google App Engine is now powerd by Java. In this presentation you will be introduced to this new world.
After this presentation you will be able to create your own application and deploy it to a complete scalable without initial cost environment.
Topics of this presentation are: create a simple web application; upload web applition to GAEj; using some google service like datastore, email sender, memcache and other
interesting feature to develop a scalable application.
All argument discussed use spring framework as glue of that services.. so we can understand how spring can help us to develop an enterprise production ready application. We show you how GAEj is a valid solution for many application purpose for its simplicity and low cost.


Massimiliano Dessì "The hidden gems of Spring Security"

Spring Security is a security solution for enterprise applications developed using the Spring Framework.
Out of the box Spring Security provide support for OpenID, ACL, Groups, JSR 250 Security Annotation and can be easily integrated with OAuth and RESTful systems.
In this presentation we will see how to use SpringSecurity to switch a RESTful webapp from a classical authentication/authorization to OpenID authentication, OAuth authorization and how to use the SpringSecurity ACL for your Domain Objects.


Mario Fusco "No more loops with lambdaj"

Lambdaj is a library that makes easier to manipulate collections in a pseudo-functional and statically typed way. In our experience to iterate over collection, especially in nested loops, is often error prone and makes the code less readable. The purpose of this library is to alleviate these problems employing some functional programming techniques but without losing the static typing of java. We impose this last constraint to make refactoring easier and safer and allow the compiler to do its job. In a word, lambdaj partially eliminates the burden to write (often nested and poorly readable) loops while iterating over collections by allowing to filter, convert, group, aggregate and sort their items without to write a single explicit loop.


Piergiorgio Lucidi "A success story: Spring in Alfresco ECM"

Alfresco is the leading open source enterprise content management system and two of the most appreciated aspects of Alfresco are: the wide customization model and the high quality of source code.
Alfresco is strongly based on Spring Framework and thanks to this adoption we can find many ways to extend and inject our components. In this presentation will be shown many ways to extend Alfresco features and interfaces using Spring application context configuration.

Monday, May 25, 2009

Status update and next worshops

Some update and next events/meetings/workshops
Since April/May I'm become:
Chairman of Jug Sardegna Onlus
OpenNMS Committer/Contributor
Scala user

As a Jug Chairman, I'm working with the jug's members, on some workshops scheduled for the next five months:

Ammentos 12 june
Scala
GWT
Android

Next update for the Spring Framework Meeting (27 June) in Cagliari

Stay tuned !

Wednesday, April 15, 2009

Good and complete review of Spring 2.5 AOP book

Spring 2.5 Aspect Oriented Programming review on javalobby

The review ends with:

"AOP itself is complex for the first time that a beginner starts to

learn it. This book avoids this problem by keeping the things simple

and not overloading with heavy theory. That means the theory and

practice are not poor (superficial) or too detailed.Developers with some experience with AOP, would find this book very good for reference,

as it has a long good amount the samples about configuration for xml and annotations.

For its 300 pages I consider this book a good material for learning concepts and good practices. I hope you enjoy this book like I did."

Thursday, March 12, 2009

Spring AOP Book - Acknowledgements

Spring AOP Book

I’d like to thank my family, my wife Monica, and my little sons Michele, Mattia and
Chiara.
Monica gave me support in writing this book and she did a great job in taking care of our
family. Without her love and support, I could never have finished this book.
Thanks to my grandparents Aldo and Maria Grazia and to my mother, for instilling in me
honesty and ethics.
Thanks to Alef Arendsen pointed out my faults, and gave valuable suggestions based on
his rich experience in Spring.
Thanks to Stefano Sanna, my copy editor, did a nice job in correcting my grammatical
mistakes, improving my words, and keeping the conventions consistent throughout the
book, and for a it’s invaluable support.
Thanks to Nelly Cannas and Samuela Girau for their support.
Many thanks to the SpringFramework team for having created such a powerful
framework to the Java community.

Thanks to italian Jugs, JugSardegna, JugRoma, JugMilano, JugPadova, JugTorino for their supports.