NetBeans Platform - an impression after the second Silesia JUG meeting
Behind us is the second meeting Silesia JUG , whose theme was the NetBeans Platform. Mark Klis over 1.5 hours presenting capabilities of this platform using a brand new NetBeans 6.5, which (probably due to its novelty), he had sometimes quite long moments hesitation. The audience this time was much smaller than the first meeting, which I think largely due to the focus of the meeting - Eclipse still is doing well and that it uses the vast majority of developers. Himself to admit that NetBeans fired just a few times in my life and this solely by the desire to experiment. At the presentation I went to learn something about the NB platform capabilities and its use to create desktop applications. I must admit that my approach was the beginning of skeptical though of course I was hoping that Mark will show you something revolutionary. As long I create applications based on Eclipse RCP, I wanted to compare the two platforms / frameworks / skeletons ..... etc..
must admit that visually it looks nice, although I personally like the UI more applications built on Eclipse. The basic application (without functionality) can be created by typing zero lines of code;) Next have no knowledge of the API can be hard, but that's understandable.
Marek tried their best to communicate about, and - taking into account the issues of space, and quite a limited time - truly appreciate his efforts:) Not cared But a few moments without going into too much detail, but it's probably the problem most of the speakers. (Hopefully it will be like someday I will stand before the audience;))
NetBeans Platform is an option to consider if one of the requirements is that the application was based on Swing. In this environment, its competitors are probably only SpringRCP and Swing Application Framework, and among them NB option seems most mature and giving the greatest opportunities today. If we are free to Swing/SWT- I definitely will choose the Eclipse RCP, but I'm not objective in this topic:) Unfortunately, too few know about the NB to more accurately compare the two platforms. This is what I have seen during the presentation of a rather slow start your application (Eclipse but sometimes results in bone).
Both platforms have long been developing dynamically. Very well that there is a kind of competition between the two products in both the IDE and platform software development, because we all benefit from such competition, and the most we - the developers to give more and more interesting tools and solutions.
Thursday, November 20, 2008
Tuesday, November 18, 2008
When Is Vitamin K Bad For You
Injecting dependencies in a Web application
You know that feeling when you're doing something after the umpteenth time, and each time worked and now nothing in the world does not want? Exactly ... I needed to do a little test to create EJB3 project in it a SLSB. Apart from this I created a web application project (Dynamic Web Project), in the middle of a class implementing ServletContextListener to be notified when injected Bean deployu EAR'a tudziez start the application server:
I added the appropriate entries to the web.xml:
several times to review all the code and nothing (!) In such situations usually helps Google - I found the clue JavaRanch , and the error was more prosaic than I thought. As you can see the web.xml file above refers to the Java Servlet specification version 2.4, while the dependency injection in servlets running on version 2.5. After the amendment, this piece web.xml looks like this:
Phew ...
You know that feeling when you're doing something after the umpteenth time, and each time worked and now nothing in the world does not want? Exactly ... I needed to do a little test to create EJB3 project in it a SLSB. Apart from this I created a web application project (Dynamic Web Project), in the middle of a class implementing ServletContextListener to be notified when injected Bean deployu EAR'a tudziez start the application server:
public class implements MyStartupListener ServletContextListener {
@ EJB private
LifecycleMonitorRemote lifeCycleMonitor
public void contextDestroyed (final ServletContextEvent arg0) {
lifeCycleMonitor.shutdown ();}
public void contextInitialized (final ServletContextEvent arg0) {
lifeCycleMonitor.startup ();}
}
I added the appropriate entries to the web.xml:
we go ... And what? I NullPointerException in line
\u0026lt;? xml version = "1.0" encoding = "UTF-8"?>
\u0026lt; web-app id = "WebApp_ID" version = "2.4" xmlns = "http://java.sun.com/xml/ns/j2ee"
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemaLocation = "http://java.sun.com/xml/ns/j2ee http://java.sun .com/xml/ns/j2ee/web-app_2_4.xsd ">
\u0026lt;display-name> test.startup.web \u0026lt;/ display-name>
\u0026lt;welcome-file-list>
\u0026lt;welcome-file> ; index.html \u0026lt;/ welcome-file>
\u0026lt;welcome-file> index.htm \u0026lt;/ welcome-file>
\u0026lt;welcome-file> index.jsp \u0026lt;/ welcome-file> default \u0026lt;welcome-file>
. html \u0026lt;/ welcome-file>
\u0026lt;welcome-file> default.htm \u0026lt;/ welcome-file>
\u0026lt;welcome-file> default.jsp \u0026lt;/ welcome-file>
\u0026lt;/ welcome-file-list>
\u0026lt;listener>
\u0026lt; ; Listener-class> listeners.MyStartupListener \u0026lt;/ Listener-class>
\u0026lt;/ Listener>
\u0026lt;servlet>
\u0026lt;description> \u0026lt;/ description>
\u0026lt;display-name> MyStartupListener \u0026lt;/ display-name>
\u0026lt;servlet-name> MyStartupListener \u0026lt;/ servlet-name>
\u0026lt;servlet-class> listeners.MyStartupListener \u0026lt;/ servlet-class>
\u0026lt;/ servlet>
\u0026lt;servlet-mapping>
\u0026lt;servlet-name> MyStartupListener \u0026lt;/ servlet-name>
\u0026lt;url-pattern> ; / MyStartupListener \u0026lt;/ url-pattern>
\u0026lt;/ servlet-mapping>
\u0026lt;/ web-app>
lifeCycleMonitor.startup ();means dependency injection if it did not work ... But it's always worked ...
several times to review all the code and nothing (!) In such situations usually helps Google - I found the clue JavaRanch , and the error was more prosaic than I thought. As you can see the web.xml file above refers to the Java Servlet specification version 2.4, while the dependency injection in servlets running on version 2.5. After the amendment, this piece web.xml looks like this:
\u0026lt;web-app xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://java.sun. com / xml / ns / JavaEE "
xmlns: web =" http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "
xsi: schemaLocation =" http://java.sun. com / xml / ns / JavaEE http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "
id =" WebApp_ID "version =" 2.5 ">
Phew ...
Friday, November 14, 2008
Drinking And Driving Scenarios For A Psa
create a plugin for Eclipse - Hello World
As probably most of the you know, Eclipse is not just a development environment (IDE), but also - and perhaps above all - the software development platform on which "by chance" was a great IDE. Underlying all this is OSGi, for which we will wipe them create applications for Eclipse platform. Even the basic meaning of existence in Eclipse - plugin - is actually packages (bundle) OSGi.
decided to bring some topics for building applications based on Eclipse, and today's column, as required by tradition, provides a basic Hello World in the world of the Eclipse Platform.
to create the simplest of the project does not take much - just installed Eclipse PDE (Plugin Development Environment). I would use the version 3.3 which I have just appended PDE.
Before we begin, you need a brief theoretical introduction. One of the basic concepts of Eclipse is the point extensions (Extension Point). Using extension points our plugins can enrich the functions of existing plug-ins (including those indigenous Eclipsowe), and also allow other plugins to extend its functionality. For example, Eclipse provides Extension point through which we can add additional menu to the top menu (which will show in a minute).
On the other hand, imagine an application that is used to convert bitmap images such as different graphic formats. Open the BMP file and the window we see a combo box with available target image formats. The Eclipse platform design of such applications can benefit from the modularity and extensibility, if each converter will do as an extension (extension), shared his point of extensions (Extension point'a). The platform allows download all the extensions that "wpinają" in a given point, so it is very easy to create a list of available target formats conversion. If we decide to add a converter to the new file format, simply to declare (via XML), that it also plugs in a given point extensions and no modification of existing code it is available in the application.
Extension Point is named (eg pl.kadamczyk.bmpconverter) and the definition in the form of XSD. The creation of points of expansion will not go far, but I hope that I can write about this in the future. Highlights for now, to remember that the point of contact extension is a place where modules can provide its functionality to other modules.
Ok, first let's make this last przydługawym first, very simple project:
Determine the name of the project, without changing the other options:
On the following screens do not change any options and finish the wizard which, after completion of his work opens a graphical editor plugin.xml file.
will want to add our Eclipse menu, and select it, after selecting the info window is displayed.
To this end, open the Extensions tab . On this tab, define how the plugin is to expand our "environment" (ie, creating Eclipse plug-ins in this case). We want to add the item to the top menu, Eclipse, and this is the point extensions org.eclipse.ui.actionSets . On the Extensions, select Add, and in the available text field Extension point type filter org.eclipse.ui.actionSets. Close the window, which adds the extension. Now you need to configure this extension. Extension point
actionSets contains have an element that you configure like this:
Then add to the menu is configured Action Set. Right click on "First action set", select New-> menu.
label type such as "Menu" Hello World "- it will appear in the menu bar when you start Eclipse. Let's leave the automatically generated ID (PluginHelloWorld.menu1)
analogy to the menu, then add a separator, without changing its properties (generated ID: "PluginHelloWorld.separator1").
At the end of the same action set way to add an action (action) and configure it like this:
Left yet to define the most important, or what action is to do. This editor allows you to name the class that is responsible for the operation of share class as a parameter the bottom of the drawing. You can also click on the link class which will run the mini-wizard. Simply select the package and enter the name of the class, and the wizard himself, "be up" the class with appropriate methods, which we have "only" fill:
define the class of shares as follows:
At this point the plugin.xml file looks like this:
That way we finished the first, simplest plugin for Eclipse - maybe he has not advanced "ficzerami," but this is the first step to create something interesting. I'll try one of the following posts to extend the functionality plug-and - who knows - maybe the way manages to create something useful;)
As probably most of the you know, Eclipse is not just a development environment (IDE), but also - and perhaps above all - the software development platform on which "by chance" was a great IDE. Underlying all this is OSGi, for which we will wipe them create applications for Eclipse platform. Even the basic meaning of existence in Eclipse - plugin - is actually packages (bundle) OSGi.
decided to bring some topics for building applications based on Eclipse, and today's column, as required by tradition, provides a basic Hello World in the world of the Eclipse Platform.
to create the simplest of the project does not take much - just installed Eclipse PDE (Plugin Development Environment). I would use the version 3.3 which I have just appended PDE.
Before we begin, you need a brief theoretical introduction. One of the basic concepts of Eclipse is the point extensions (Extension Point). Using extension points our plugins can enrich the functions of existing plug-ins (including those indigenous Eclipsowe), and also allow other plugins to extend its functionality. For example, Eclipse provides Extension point through which we can add additional menu to the top menu (which will show in a minute).
On the other hand, imagine an application that is used to convert bitmap images such as different graphic formats. Open the BMP file and the window we see a combo box with available target image formats. The Eclipse platform design of such applications can benefit from the modularity and extensibility, if each converter will do as an extension (extension), shared his point of extensions (Extension point'a). The platform allows download all the extensions that "wpinają" in a given point, so it is very easy to create a list of available target formats conversion. If we decide to add a converter to the new file format, simply to declare (via XML), that it also plugs in a given point extensions and no modification of existing code it is available in the application.
Extension Point is named (eg pl.kadamczyk.bmpconverter) and the definition in the form of XSD. The creation of points of expansion will not go far, but I hope that I can write about this in the future. Highlights for now, to remember that the point of contact extension is a place where modules can provide its functionality to other modules.
Ok, first let's make this last przydługawym first, very simple project:
Determine the name of the project, without changing the other options:
On the following screens do not change any options and finish the wizard which, after completion of his work opens a graphical editor plugin.xml file. will want to add our Eclipse menu, and select it, after selecting the info window is displayed.
To this end, open the Extensions tab . On this tab, define how the plugin is to expand our "environment" (ie, creating Eclipse plug-ins in this case). We want to add the item to the top menu, Eclipse, and this is the point extensions org.eclipse.ui.actionSets . On the Extensions, select Add, and in the available text field Extension point type filter org.eclipse.ui.actionSets. Close the window, which adds the extension. Now you need to configure this extension. Extension point
actionSets contains have an element that you configure like this:
Then add to the menu is configured Action Set. Right click on "First action set", select New-> menu. label type such as "Menu" Hello World "- it will appear in the menu bar when you start Eclipse. Let's leave the automatically generated ID (PluginHelloWorld.menu1)
analogy to the menu, then add a separator, without changing its properties (generated ID: "PluginHelloWorld.separator1").
At the end of the same action set way to add an action (action) and configure it like this:
Left yet to define the most important, or what action is to do. This editor allows you to name the class that is responsible for the operation of share class as a parameter the bottom of the drawing. You can also click on the link class which will run the mini-wizard. Simply select the package and enter the name of the class, and the wizard himself, "be up" the class with appropriate methods, which we have "only" fill:
define the class of shares as follows:
sampleeclipseplugin package;
org.eclipse import. jface.action.IAction;
org.eclipse.jface.dialogs.MessageDialog import;
import org.eclipse.jface.viewers.ISelection;
org.eclipse.ui.IWorkbenchWindow import, import
org.eclipse.ui.IWorkbenchWindowActionDelegate;
public class implements SayHelloAction IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
public void dispose () {
/ / empty
} public void init (final IWorkbenchWindow window) {
this.window = window;
} public void run (final IAction action) {
MessageDialog.openInformation (window.getShell ( ), "Hello!"
"I'm the first plugin for Eclipse");}
public void selectionChanged (final IAction action, final
ISelection selection) {
/ / empty
}}
At this point the plugin.xml file looks like this:
plugin to start moving the first tab editor plugin.xml file, and there in the Testing section, choose the Launch an Eclipse application. Running is a new instance of Eclipse with an accompanying our plugin. In the top menu is already visible extension defined by us (new menu item).
\u0026lt;? xml version = "1.0" encoding = "UTF UTF-8 "?>
\u0026lt;? eclipse version =" 3.2 "?>
\u0026lt;plugin>
\u0026lt;extension
id="myActionSet"
point="org.eclipse.ui.actionSets">
\u0026lt; ; actionSet
id = "PluginHelloWorld.actionSet1"
label = "My simple plugin"
visible = "true">
\u0026lt;menu
id = "PluginHelloWorld.menu1"
label = "My free menu">
\u0026lt;separator
name="PluginHelloWorld.separator1">
\u0026lt;/ separator>
\u0026lt;/ menu>
\u0026lt;
class action = "sampleeclipseplugin.SayHelloAction"
id = "PluginHelloWorld.action1"
label = "Przedstaw sie"
menubarPath = "PluginHelloWorld.menu1/PluginHelloWorld.separator1">
\u0026lt;/ action>
\u0026lt;/ Actions>
\u0026lt; / extension>
\u0026lt;/ plugin>
That way we finished the first, simplest plugin for Eclipse - maybe he has not advanced "ficzerami," but this is the first step to create something interesting. I'll try one of the following posts to extend the functionality plug-and - who knows - maybe the way manages to create something useful;)
Tuesday, November 11, 2008
2 Days Late Period Cervix
PropertyChangeSupport - calling using Spring AOP
In the previous text, I described how to deal with the problem that is described in a post titled pl.comp.lang.java JavaBeans - bad idea using pure AspectJ . Today I'll show how to do the same thing using Spring AOP (remember - it is a notification object for each call PropertyChangeSupport setter for JavaBean'ie).
solution is the most important part of the interceptor, which intercepts calls setter:
This is partly revised version of aspects of the previous post, adjusted to Springowego API.
second step is to configure interceptor:
Unlike the first solution, which used a pure and AspectJ compile-time-weaving, here Applying advice is made in the course of action.
consequence of this is to change how you use the class model. To Spring AOP can generate the appropriate proxy at runtime, you need to download an object from the factory - in our case it will be ClassPathXmlApplicationContext:
As before, the result of the method is main inscription on the console:
MethodInterceptor: Change the value of field someIntProperty
MethodInterceptor: Change the value of field someStringProperty
In the previous text, I described how to deal with the problem that is described in a post titled pl.comp.lang.java JavaBeans - bad idea using pure AspectJ . Today I'll show how to do the same thing using Spring AOP (remember - it is a notification object for each call PropertyChangeSupport setter for JavaBean'ie).
solution is the most important part of the interceptor, which intercepts calls setter:
pl.kadamczyk.springpropertychange.interceptors package;
import java.lang.reflect.Field;
org.aopalliance.intercept.MethodInterceptor import, import
org.aopalliance.intercept.MethodInvocation;
import pl.kadamczyk.springpropertychange.model.BaseModelObject;
public class SetterMethodInterceptor implements MethodInterceptor
{/ ** *
surrounds the actual method call
* / public Object invoke
(final MethodInvocation method) throws Throwable {String
method.getMethod jointPoint = (). getName ();
/ / Specify the name of the field based on the name induced by setter
String fieldName = jointPoint.replaceFirst ("set", "");
fieldName = Character.toLowerCase (fieldName.charAt (0)) +
fieldName.substring (1);
try {Object target = method.getThis ();
Class clazz = target.getClass ();
/ / grab the box before the scheduled class called
Field field = clazz.getDeclaredField (fieldName);
field.setAccessible (true);
/ / grab the old value Object oldValue
field field.get = (target);
/ / permit Call up setter
method.proceed Object result = ();
if (method.getArguments (). length == 1) {
triggerPropertyChange (target, method.getArguments () [0],
oldValue, fieldName);}
return result;
} catch (NoSuchFieldException e) {throw new RuntimeException
(e);
} catch (IllegalArgumentException e) { throw new RuntimeException
(e);
} catch (IllegalAccessException e) {throw new RuntimeException
(e);
} catch (Throwable e) {throw new RuntimeException
(e);}
} / **
* Checks whether the method was performed on the object class that inherits
* after BaseModelObject, and if so, calls on him firePropertyChange
* / private void
triggerPropertyChange (final Object target, Object newval
final, final Object oldValue, final String fieldName) {
System.out.println ("MethodInterceptor: Change the value of field "
+ fieldName);
if (target instanceof BaseModelObject)
{/ / call the method from the base class
((BaseModelObject) target). firePropertyChange (fieldName, oldValue,
newval);
}}}
This is partly revised version of aspects of the previous post, adjusted to Springowego API.
second step is to configure interceptor:
Noteworthy pointcut.setterAdvisor bean that is responsible for linking the pointcut'ami interceptor where it be applied.
\u0026lt;? Xml version = "1.0" encoding = "UTF-8"?>
\u0026lt;beans xmlns = "http://www.springframework.org/schema/ beans "
xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "
xmlns: aop =" http://www.springframework.org/schema/aop "
xmlns: context =" http://www.springframework.org/schema/context "
xsi: schemaLocation ="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring- aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<aop:aspectj-autoproxy />
<bean id="someModelObject"
class="pl.kadamczyk.springpropertychange.model.SomeModelObject"
scope="prototype" />
<bean name="setterInterceptor"
class="pl.kadamczyk.springpropertychange.interceptors.SetterMethodInterceptor" />
<bean name="pointcut.setterAdvisor"
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
\u0026lt;property name="advice" ref="setterInterceptor" />
\u0026lt;property name="mappedName" value="set*" />
\u0026lt;/ bean>
\u0026lt;/ beans>
Unlike the first solution, which used a pure and AspectJ compile-time-weaving, here Applying advice is made in the course of action.
consequence of this is to change how you use the class model. To Spring AOP can generate the appropriate proxy at runtime, you need to download an object from the factory - in our case it will be ClassPathXmlApplicationContext:
Note that the bean someModelObject Spring'a in the configuration file is defined with the attribute scope = "prototype" context.getBean drew to call every time a new instance.
public static void main (final String [] args) {
AbstractApplicationContext context = new ClassPathXmlApplicationContext (
"beans.xml");
SomeModelObject modelObject = (SomeModelObject) context
. getBean ("someModelObject");
modelObject.setSomeIntProperty (23);
modelObject.setSomeStringProperty (ala ');}
As before, the result of the method is main inscription on the console:
MethodInterceptor: Change the value of field someIntProperty
MethodInterceptor: Change the value of field someStringProperty
Thursday, November 6, 2008
New Baby And A Six Year Old
PropertyChangeSupport - calling using AspectJ
Inspired by a post Chris (aka Kolszew) entitled JavaBeans - bad idea pl.comp.lang.java decided to prepare an example demonstrating the use of Aspect Oriented Programming (specifically AspectJ) to solve the problem presented by Chris. I'm interested in getting
setter selected classes of behavior is identical with the following words:
without adding in any setterze first and third of these lines of code.
The first step is to create the project. Plugin AJDT (AspectJ Development Tools ) to the Eclipse AspectJ project allows the creation of (New-> Project AspectJ) containing immediately hooked bilbioteki AJ.
I create a base class for classes of model that provides a method firePropertyChange which simply delegates the call to a private field of type PropertyChangeSupport.
Let's test a class that inherits from BaseModelObject:
It is the coolest moment: create aspect of who is responsible for invoking the method firePropertyChange class BaseModelObject:
Defined call pointcut specifies all methods in all classes in package pl.kadamczyk.ajpropertychange.model name that begins with "set" and the return type "void". Defining
Tips (advice) of the type around allows you to perform operations both before and after the proper method to liberate calling proceed () .
also deserves a special variable used thisJoinPoint - this is an analogy to the standard Javowego this - this variable may be used only in the context of counseling (advice). It contains many przydatnich information about the current Join Point, which is in our case caused by a particular setter. In particular, calling:
To see the result of the above aspect run a simple class with a method main () :
to get the console output:
Change the value of field someIntProperty
Change the value of field someStringProperty
We note at the end - This code will not work with the appropriate manager fired security, because it will not allow the method call setAccesible (true) on the fields.
Taking this into account in a different way to get the value of the field - here I used a 'hack' with the method setAccesible because it was the fastest;)
Inspired by a post Chris (aka Kolszew) entitled JavaBeans - bad idea pl.comp.lang.java decided to prepare an example demonstrating the use of Aspect Oriented Programming (specifically AspectJ) to solve the problem presented by Chris. I'm interested in getting
setter selected classes of behavior is identical with the following words:
void setText (String txt) {String oldValue =
this.text;
this.text = txt;
propertyChangeSupport.firePropertyChange ("text", oldValue, txt );}
without adding in any setterze first and third of these lines of code.
The first step is to create the project. Plugin AJDT (AspectJ Development Tools ) to the Eclipse AspectJ project allows the creation of (New-> Project AspectJ) containing immediately hooked bilbioteki AJ.
I create a base class for classes of model that provides a method firePropertyChange which simply delegates the call to a private field of type PropertyChangeSupport.
import java.beans.PropertyChangeSupport;
BaseModelObject {public class
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport (
this);
public void firePropertyChange (final String propertyName, Object oldValue
final, final Object newValue) {
propertyChangeSupport.firePropertyChange (propertyName, oldValue, newValue
);
}}
Let's test a class that inherits from BaseModelObject:
pl.kadamczyk.ajpropertychange.model package;
public class extends SomeModelObject BaseModelObject {private String
someStringProperty;
private int someIntProperty;
getSomeStringProperty public String () {return
someStringProperty;
}
public void setSomeStringProperty (final String someStringProperty) {
this.someStringProperty = someStringProperty;
} public int
getSomeIntProperty () {return
someIntProperty;
} public void
setSomeIntProperty (final int someIntProperty) {
this.someIntProperty = someIntProperty;
}}
It is the coolest moment: create aspect of who is responsible for invoking the method firePropertyChange class BaseModelObject:
pl.kadamczyk.ajpropertychange.aspects package;
pl.kadamczyk.ajpropertychange.model import. BaseModelObject;
public aspect PropertyChangeAspect {
/ **
* We define "place" where applied shall Tip
* /
pointcut callSetter (Object target, Object param): target (target) & & args (arg) & &
execution ( void set pl.kadamczyk.ajpropertychange.model .*. *(..));
/ ** * Tip type
around - to execute code before and after appropriate
* method is called.
* * /
Object around (Object target, Object newval): callSetter (target, newval) {String
jointPoint = ThisJoinPoint.getSignature (). GetName ();
/ / Specify the name of the field induced by the name of the setter
String fieldName = jointPoint.replaceFirst ("set", "");
fieldName = Character.toLowerCase (fieldName.charAt (0 )) +
fieldName.substring (1);
try {Class clazz =
target.getClass ();
/ / grab the box before the scheduled class called
java.lang.reflect.Field field = clazz.getDeclaredField (fieldName );
field.setAccessible (true);
/ / grab the old value Object oldValue
field field.get = (target);
/ / allow to call setter
Object result = proceed (target, newval);
triggerPropertyChange (target, newval, oldValue, fieldName);
return result;
} catch (NoSuchFieldException e) {throw new RuntimeException
(e);
} catch (IllegalArgumentException e) {throw new RuntimeException
(e);
} catch (IllegalAccessException e) {throw new RuntimeException
(e);}
} / ** * Checks
whether the method was performed on object class that inherits from the BaseModelObject
*, and if so, calls on him firePropertyChange
* / private void
triggerPropertyChange (final Object target, Object newval
final, final Object oldValue, final String fieldName) {
System.out.println ("Changing the value of field" + fieldName);
if (target instanceof BaseModelObject)
{/ / call the method from the base class
((BaseModelObject) target). firePropertyChange (fieldName, oldValue,
newval);
}}}
Defined call pointcut specifies all methods in all classes in package pl.kadamczyk.ajpropertychange.model name that begins with "set" and the return type "void". Defining
Tips (advice) of the type around allows you to perform operations both before and after the proper method to liberate calling proceed () .
also deserves a special variable used thisJoinPoint - this is an analogy to the standard Javowego this - this variable may be used only in the context of counseling (advice). It contains many przydatnich information about the current Join Point, which is in our case caused by a particular setter. In particular, calling:
thisJoinPoint.getSignature (). GetName () returns the name of the currentlymethod invoked by the set *.
To see the result of the above aspect run a simple class with a method main () :
pl.kadamczyk.ajpropertychange.launcher package;
import pl.kadamczyk.ajpropertychange.model.SomeModelObject;
public class Launcher {public static
void main (final String [] args) {
SomeModelObject SomeModelObject mo = new ();
mo.setSomeIntProperty (23);
mo.setSomeStringProperty ('ala has a cat ");}
}
to get the console output:
Change the value of field someIntProperty
Change the value of field someStringProperty
We note at the end - This code will not work with the appropriate manager fired security, because it will not allow the method call setAccesible (true) on the fields.
Taking this into account in a different way to get the value of the field - here I used a 'hack' with the method setAccesible because it was the fastest;)
Shadi Cards Walima Invitations Wordings
JPA, Distributed Transactions i MS SQL Server
For the first time I face the issue distributed transactions, and is immediately in contact with MS SQL Server, which - in my opinion - is a Java-friendly medium.
itself necessitates the use of distributed transactions resulted from the requirement to export data from one database (database A - PostgreSQL) to another (base B - MS SQL). During the same export data from database A must be marked as exported successfully. Where in the record to the database B, something goes wrong, the transaction is rollbackowana and data in database A does not receive the flag "exported".
In principle, all beautifully - worse in practice. It turned out that the inclusion of support for XA transactions in MS SQL tymaga implementation of a large number of steps that I describe below:
Aha! And watch out for SQL Server 2008 (do not know if earlier versions too) - standard Only option is enabled a user logs on to Windows Authentication, so you can not log
through JDBC's database. Only manually activate this option helps;)
For the first time I face the issue distributed transactions, and is immediately in contact with MS SQL Server, which - in my opinion - is a Java-friendly medium.
itself necessitates the use of distributed transactions resulted from the requirement to export data from one database (database A - PostgreSQL) to another (base B - MS SQL). During the same export data from database A must be marked as exported successfully. Where in the record to the database B, something goes wrong, the transaction is rollbackowana and data in database A does not receive the flag "exported".
In principle, all beautifully - worse in practice. It turned out that the inclusion of support for XA transactions in MS SQL tymaga implementation of a large number of steps that I describe below:
- Enable distributed transactions on Windows is installed on SQL Server - described here.
- Configure System Distributed Transaction Coordinator (Distributed Transactions Coordinator) to start automatically at boot
- Download JDBC driver.
- the downloaded driver package locate the file sqljdbc_xa.dll (appropriate for the architecture) and place it in the directory structure of SQL Server.
This file contains the implementations of stored procedures, responsible for distributed transactions.
- Select the operating system location of this file. To do this, add to the registry key
HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ MSDTC \\ XADLL
entry type string value (REG_SZ) being named DLL file name and a value which is the path to This file (including with the same name). In my case it was:
name: sqljdbc_xa.dll
value: C: \\ Program Files \\ Microsoft SQL Server \\ 100 \\ Shared \\ sqljdbc_xa.dll - the installed instance of SQL Server installs run the SQL script needed stored procedures. The script can be of the form:
use master
it
sp_addextendedproc exec 'xp_sqljdbc_xa_init', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_start', 'SQLJDBC_XA.dll '
sp_addextendedproc exec 'xp_sqljdbc_xa_end', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_prepare', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_commit', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_rollback', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_forget', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_recover', 'SQLJDBC_XA.dll'
sp_addextendedproc exec 'xp_sqljdbc_xa_rollback_ex', 'SQLJDBC_XA.dll'
exec sp_addextendedproc 'xp_sqljdbc_xa_forget_ex', 'SQLJDBC_XA.dll'
exec sp_addextendedproc 'xp_sqljdbc_xa_prepare_ex', 'SQLJDBC_XA.dll'
go
grant execute on xp_sqljdbc_xa_init to public
grant execute on xp_sqljdbc_xa_start to public
grant execute on xp_sqljdbc_xa_end to public
grant execute on xp_sqljdbc_xa_prepare to public
grant execute on xp_sqljdbc_xa_commit to public
GRANT EXECUTE ON xp_sqljdbc_xa_rollback is public
grant execute on xp_sqljdbc_xa_recover is public
grant execute on xp_sqljdbc_xa_forget is public
grant execute on xp_sqljdbc_xa_rollback_ex is public
grant execute on xp_sqljdbc_xa_forget_ex is public
grant execute on xp_sqljdbc_xa_prepare_ex is public
it
- Configuring Connection Pool:
DataSource classname = com.microsoft.sqlserver.jdbc.SQLServerXADataSource
Resource type = javax.sql.XADataSource
- sqljdbc.jar file for Java 5
- sqljdbc4.jar-file for the Java 6
Aha! And watch out for SQL Server 2008 (do not know if earlier versions too) - standard Only option is enabled a user logs on to Windows Authentication, so you can not log
through JDBC's database. Only manually activate this option helps;)
How To Stoped My Erectile
Ruszamy :)
Welcome to my "freshly baked" blog:) I'll try (as far as free time, which is a small number will be fewer;)) on these pages describe the problems faced by the daily work. I hope it will become in the future, a place where you can find interesting information and discuss issues about which I write and solve which I propose. I treat this blog as a kind of challenge, and - of course - I look forward to your constructive criticism. Well, we start! :)
Welcome to my "freshly baked" blog:) I'll try (as far as free time, which is a small number will be fewer;)) on these pages describe the problems faced by the daily work. I hope it will become in the future, a place where you can find interesting information and discuss issues about which I write and solve which I propose. I treat this blog as a kind of challenge, and - of course - I look forward to your constructive criticism. Well, we start! :)
Saturday, May 24, 2008
Blond Highlights Picturtes
Indefinite Break!
1 .- After long time of not updating the blog, I am saying this desicion. NO will upload more albums until further notice. The reasons, I do not have internet in my house and ill intentioned that charge that the files are illegal, so gigasize delete them. I hope in a few more months to continue to solve both problems compartirndo This musical passion with you. Greetings and hold the metal!.
1 .- After long time of not updating the blog, I am saying this desicion. NO will upload more albums until further notice. The reasons, I do not have internet in my house and ill intentioned that charge that the files are illegal, so gigasize delete them. I hope in a few more months to continue to solve both problems compartirndo This musical passion with you. Greetings and hold the metal!.
Tuesday, April 22, 2008
Faking Community Service For School
Dark Moor - 2007 - Tarot [reuploaded]
Dark Moor is an excellent English band, here are his latest album titled Tarot, excellent sounds, a highly recommended disc.
Tracklist 01. The Magician
02. The Chariot
03. The Star
04. Wheel Of Fortune
05. The Emperor
06. Devil In The Tower
07. Death
08.
Lovers 09. The Hanged Man
10. The Moon
11. The Fool (Bonus Track)
Descargar / Download
(for Reraising again)
Uploader: Pathfinder
Dark Moor is an excellent English band, here are his latest album titled Tarot, excellent sounds, a highly recommended disc.
Name:
Dark Moor Album: Tarot
Year: 2007
Genre: Power Metal
Country: Spain
Dark Moor Album: Tarot
Year: 2007
Genre: Power Metal
Country: Spain
Tracklist 01. The Magician
02. The Chariot
03. The Star
04. Wheel Of Fortune
05. The Emperor
06. Devil In The Tower
07. Death
08.
Lovers 09. The Hanged Man
10. The Moon
11. The Fool (Bonus Track)
Descargar / Download
(for Reraising again)
Uploader: Pathfinder
Tuesday, April 15, 2008
Harbor Breeze Fan Remote Reset
Polymer - 2001 - Metropolis [Re uploaded]
first and only album by this band Chilean Power / Progressive Metal, entitled Metropolis published in 2001, a spectacular album that made them receive the nickname of the Dream Theater in Chile, is up to them to listen and you will realize. NADB a principality called the Metropolis but decided to switch to legal issues tester. It is a shame that this band does not continue after this separation the brothers formed the band Esquivel Chilean Mythology.
first and only album by this band Chilean Power / Progressive Metal, entitled Metropolis published in 2001, a spectacular album that made them receive the nickname of the Dream Theater in Chile, is up to them to listen and you will realize. NADB a principality called the Metropolis but decided to switch to legal issues tester. It is a shame that this band does not continue after this separation the brothers formed the band Esquivel Chilean Mythology.
Name: Polymer
Album: Metropolis
Year: 2001
Gender: Power / Progressive Metal
Country: Chile
Tracklist 01 - Intro.mp3
02 - Laberintos.mp3
03 - Gods Negros.mp3
04 - Fabulas.mp3
05 - Sons Of Temor.mp3
06 - Sola.mp3
07 - I pretend to be Fuerte.mp3
08 - Wars Eternas.mp3
09 - Light And Sombra.mp3
10 - Traición.mp3
11 - Episodios.mp3
12 - Instru Mental.mp3
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
password to be / Password: http://twilight-of-the-gods.blogspot.com
Greetings to all!
Album: Metropolis
Year: 2001
Gender: Power / Progressive Metal
Country: Chile
Tracklist 01 - Intro.mp3
02 - Laberintos.mp3
03 - Gods Negros.mp3
04 - Fabulas.mp3
05 - Sons Of Temor.mp3
06 - Sola.mp3
07 - I pretend to be Fuerte.mp3
08 - Wars Eternas.mp3
09 - Light And Sombra.mp3
10 - Traición.mp3
11 - Episodios.mp3
12 - Instru Mental.mp3
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
password to be / Password: http://twilight-of-the-gods.blogspot.com
Greetings to all!
Sunday, April 6, 2008
Signal Systems For Elderly Care
Coda - 1995 - Twenty To Twelve
Well here a disc from a Mexican band, little comment because I'm short on time, I will just leave the disc, I recommend, then another disk fails them.
1 - Put the world around
2 - If I had you here
3 - Give me some time
4 - Even
5 - Another Ringtone to gray
6 - Twenty to twelve (the heat of the night)
7 - Frio
8 - Solo
9 - I can not live without you
10 - Be
11 - Nothing in Common
Link:
Gigasize Pass: Damnation
Well here a disc from a Mexican band, little comment because I'm short on time, I will just leave the disc, I recommend, then another disk fails them.
Banda: Coda
Album: Twenty to twelve
Year: 1995
Genre: Rock
Country: Mexico
Album: Twenty to twelve
Year: 1995
Genre: Rock
Country: Mexico
1 - Put the world around 2 - If I had you here
3 - Give me some time
4 - Even
5 - Another Ringtone to gray
6 - Twenty to twelve (the heat of the night)
7 - Frio
8 - Solo
9 - I can not live without you
10 - Be
11 - Nothing in Common
Link:
Gigasize Pass: Damnation
Saturday, April 5, 2008
How Do I Send An Invite For 3 Birthdays?
Kamelot - 2007 - Myths & Legends Of Kamelot
This compilation of Americans Kamelot is great, good quality tracks appeared on their b-sides, bonus track or some issues that had not even been published, something like a rarity. Buno I hope you enjoy this very good.
This compilation of Americans Kamelot is great, good quality tracks appeared on their b-sides, bonus track or some issues that had not even been published, something like a rarity. Buno I hope you enjoy this very good.
Banda: Kamelot
Album: Myths & Legends Of Kamelot
Year: 2007
Country: USA
Genre: Power Metal
Tracklist
01 - Kamelot - Future Kings (Japanese album Karma bonus track 2001)
02 - Kamelot - Like The Shadows (Japanese album Epica bonus track 2003)
03 - Kamelot - Ne Pleure Pas (US album Karma bonus track 2001)
04 - Kamelot - Soul Society (Radio Edit Version Japanese album The Black Halo bonus track 2005)
05 - Kamelot - Epilogue (Japanese album The Black Halo bonus track 2005)
06 - Kamelot - We Are Not Separate (Rare track 2000)
07 - Kamelot - We Three Kings (Rare track 2000)
08 - Kamelot - One Day (Japanese album Siege Perilous bonus track 1998)
09 - Kamelot - The Haunting (Somewhere In Time) (Radio Edit Version album The Black Halo Ltd edition bonus track 2005)
10 - Kamelot - March Of Mephisto (Radio Edit Version album The Black Halo Ltd edition bonus track 2005)
11 - Kamelot - Can You Remember (Japanese album the Fourth Legacy bonus track 2000)
12 - Kamelot - Snow (Album Epica Ltd edition bonus track 2003)
13 - Kamelot - Season's End (Japanese album Ghost Opera bonus track 2007)
14 - Kamelot - The Pendulous Fall (Album Ghost Opera Ltd edition bonus track 2007)
15 - Kamelot - Epilogue - Live (Japanese album Cold Winter's Nights bonus track 2006)
Descargar/Download
Uploader: Pathfinder
Servidor/Server: Gigasize
Contraseña/Password: http://twilight-of-the-gods.blogspot.com
Greetings to all!
Album: Myths & Legends Of Kamelot
Year: 2007
Country: USA
Genre: Power Metal
Tracklist 01 - Kamelot - Future Kings (Japanese album Karma bonus track 2001)
02 - Kamelot - Like The Shadows (Japanese album Epica bonus track 2003)
03 - Kamelot - Ne Pleure Pas (US album Karma bonus track 2001)
04 - Kamelot - Soul Society (Radio Edit Version Japanese album The Black Halo bonus track 2005)
05 - Kamelot - Epilogue (Japanese album The Black Halo bonus track 2005)
06 - Kamelot - We Are Not Separate (Rare track 2000)
07 - Kamelot - We Three Kings (Rare track 2000)
08 - Kamelot - One Day (Japanese album Siege Perilous bonus track 1998)
09 - Kamelot - The Haunting (Somewhere In Time) (Radio Edit Version album The Black Halo Ltd edition bonus track 2005)
10 - Kamelot - March Of Mephisto (Radio Edit Version album The Black Halo Ltd edition bonus track 2005)
11 - Kamelot - Can You Remember (Japanese album the Fourth Legacy bonus track 2000)
12 - Kamelot - Snow (Album Epica Ltd edition bonus track 2003)
13 - Kamelot - Season's End (Japanese album Ghost Opera bonus track 2007)
14 - Kamelot - The Pendulous Fall (Album Ghost Opera Ltd edition bonus track 2007)
15 - Kamelot - Epilogue - Live (Japanese album Cold Winter's Nights bonus track 2006)
Descargar/Download
Uploader: Pathfinder
Servidor/Server: Gigasize
Contraseña/Password: http://twilight-of-the-gods.blogspot.com
Greetings to all!
Buy A Comoflauge Cake
Helloween - 1989 - Live In The UK
Happy happy Halloween!
Hi, this wonder Delight Live Album (=, I know that in many places are looking but not so strange. No doubt with the Live '88 are great as well Kiske's voice sounds spectacular.
Greetings
Tracklist 1.
A Little Time 6:31 2. Dr. Stein 07 : 00
3.
Future World 9:33 4.
Rise And Fall 4:51 5. We Got The Right 6:08
6.
I Want Out 5:44 7. How Many Tears 9:55
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
Password / Password: http://twilight-of-the-gods.blogspot.com
Happy happy Halloween!
Hi, this wonder Delight Live Album (=, I know that in many places are looking but not so strange. No doubt with the Live '88 are great as well Kiske's voice sounds spectacular.
Greetings
Banda: Helloween
Country: Germany
Album: Live In The UK
Year: 1989
Genre: Power Metal
Country: Germany
Album: Live In The UK
Year: 1989
Genre: Power Metal
Tracklist 1.
A Little Time 6:31 2. Dr. Stein 07 : 00
3.
Future World 9:33 4.
Rise And Fall 4:51 5. We Got The Right 6:08
6.
I Want Out 5:44 7. How Many Tears 9:55
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
Password / Password: http://twilight-of-the-gods.blogspot.com
If You Had Hiv Wouldnt You Get Sick
Barilari - 2003 - Barilari [reuploaded]
Hi all, today I bring a disk that already had been published by Damnation last year, so I hope you enjoy it. Greetings!
Tracklist 1 - Master of Darkness
2 - Bring Your Love
3 - Languages Fire
4 - The Shadows Will Remain Behind
5 - Beginning and End
6 - Owner of a Dream
7 - Grin
8 - La Gran Victoria
9 - The Legend of Fairy and Wizard
10 - I remember in the Skin
11 - Stargazer (astronomer)
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
Password / Password: http://twilight-of-the-gods.blogspot.com
Greetings all (=.
Hi all, today I bring a disk that already had been published by Damnation last year, so I hope you enjoy it. Greetings!
Artist: Adrian Barilari
Album: Barilari
Year: 2003
Genre: Heavy / Power Metal
Album: Barilari
Year: 2003
Genre: Heavy / Power Metal
Tracklist 1 - Master of Darkness
2 - Bring Your Love
3 - Languages Fire
4 - The Shadows Will Remain Behind
5 - Beginning and End
6 - Owner of a Dream
7 - Grin
8 - La Gran Victoria
9 - The Legend of Fairy and Wizard
10 - I remember in the Skin
11 - Stargazer (astronomer)
Descargar / Download
Uploader: Pathfinder
Server / Server: Gigasize
Password / Password: http://twilight-of-the-gods.blogspot.com
Greetings all (=.
Thursday, April 3, 2008
Myfriendhotmom.comree
To Mera - Transcendental (reuploaded by request) + Delusions
Good order and so here I take to stop their 2nd album this year too, I must admit that both works are really good and progressive preaching is quite innovative in the Delusions, well judge for yourself.
Good order and so here I take to stop their 2nd album this year too, I must admit that both works are really good and progressive preaching is quite innovative in the Delusions, well judge for yourself.
Banda: To Mera
Album: Transcendental
Year: 2006
Genre: Progressive Metal
Country: England
1 - Traces
2 - Blood
3 - Dreadful Angel
4 - Phantoms
5 - Born of Ashes
6 - Parfum
7 - Obscure Oblivion
8 - Realm Of Dreams
Pass: Damnation
Banda: To Mera
Album: Delusions
Year: 2008
1 - The Lie
2 - Mirage
3 - The Glory of a New
Day 4 - Inside the Hourglass
5 - A Sorrow To Kill
6 - Asylum
7 - From Grace
Fallem 8 - Temptation
Link:
Gigasize Pass: Damnation
Album: Transcendental
Year: 2006
Genre: Progressive Metal
Country: England
1 - Traces 2 - Blood
3 - Dreadful Angel
4 - Phantoms
5 - Born of Ashes
6 - Parfum
7 - Obscure Oblivion
8 - Realm Of Dreams
Pass: Damnation
Banda: To Mera
Album: Delusions
Year: 2008
1 - The Lie 2 - Mirage
3 - The Glory of a New
Day 4 - Inside the Hourglass
5 - A Sorrow To Kill
6 - Asylum
7 - From Grace
Fallem 8 - Temptation
Link:
Gigasize Pass: Damnation
Greetings ...
Tuesday, April 1, 2008
What Do Refugee Camps Do
Whitesnake - 2008 - Good To Be Bad
Good drawback here after me that I have problems uploading overnight, but bueh are details. Here
work Whitesnake this year, went a bit normal, but they are like here goes.
Good drawback here after me that I have problems uploading overnight, but bueh are details. Here
work Whitesnake this year, went a bit normal, but they are like here goes.
Banda:
Whitesnake Album: Good to be bad
Year: 2008
Genre: Hard Rock
Best Years Can You Hear The Wind Blow
Call On Me
All I Want All I Need
Good To Be Bad All For Love
Summer Rain Lay Down Your Love
A Fool in Love
What Go You Need
Til The End of Time
Link: Gigasize
Whitesnake Album: Good to be bad
Year: 2008
Genre: Hard Rock
Best Years Can You Hear The Wind Blow
Call On Me
All I Want All I Need
Good To Be Bad All For Love
Summer Rain Lay Down Your Love
A Fool in Love
What Go You Need
Til The End of Time
Link: Gigasize
pass: Damnation
Greetings, I will try to go more often making contributions. The other admin
disappeared xD!
disappeared xD!
Subscribe to:
Posts (Atom)