JBoss Programmatically timers
Sorry, but this post is not available in English
Add comment 27 February 2008 at 3:52 PM
Sorry, but this post is not available in English
Add comment 27 February 2008 at 3:52 PM
Sorry, but this post is not available in English
Add comment 17 January 2008 at 11:12 AM
Sorry, but this post is not available in English
Add comment 11 January 2008 at 12:20 PM
Sorry, but this post is not available in English
Add comment 10 January 2008 at 12:23 PM
Sorry, but this post is not available in English
Add comment 3 January 2008 at 4:56 PM
It needs to deploy RMI Adaptor service in singleton. I can do it creating file above in deploy-hasingleton (singleton-jmx-adapter-service.xml will be ok, it’s necessary it ends with -service.xml):
<server>
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory" name="jboss.jmx:type=singletonadaptor,name=Invoker,protocol=jrmp,service=proxyFactory">
<!-- Use the standard JRMPInvoker from conf/jboss-service.xxml -->
<depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp
<attribute name=”ClientInterceptors”>
<interceptors>
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</interceptors>
</attribute>
</mbean>
</server>
Then inside any session of any cluster node I can invoke a method of MBean Service in this way:
final String RMI_ADAPTOR_JNDI_NAME = "jmx/invoker/SingletonRMIAdaptor";
final String IDTAG_SERVICE_JNDI_NAME = "MyService:service=MyManagerService";
try {
final Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, "10.x.x.1:1100,10.x.x.2:1100"); // HA
InitialContext initialContext = new InitialContext(properties);
RMIAdaptor adaptor = (RMIAdaptor) initialContext.lookup(RMI_ADAPTOR_JNDI_NAME);
ObjectName objectName = new ObjectName(IDTAG_SERVICE_JNDI_NAME);
if (adaptor != null && adaptor.isRegistered(objectName)) {
obj = adaptor.invoke(objectName, methodName, params, signature);
} else {
logWriter.debug("---- Error invoking MyManager service: " + adaptor + " ----");
throw new Exception("Error invoking MyManager service");
}
} catch (NamingException ex) {
logWriter.error(ex);
throw ex;
} catch (MalformedObjectNameException ex) {
logWriter.error(ex);
throw ex;
} catch (IOException ex) {
logWriter.error(ex);
throw ex;
} catch (InstanceNotFoundException ex) {
logWriter.error(ex);
throw ex;
} catch (MBeanException ex) {
logWriter.error(ex);
throw ex;
} catch (ReflectionException ex) {
logWriter.error(ex);
throw ex;
}
That’s all…
Add comment 13 September 2007 at 6:17 PM
To read a Samba file system in a shell is essential install smbfs libraries, then in Ubuntu:
~$ sudo apt-get install smbfs
Then I create mount directory (for es. /mnt/mysamba) and write:
~$ sudo mount -t smbfs -o username=myusername //myserversamba/project /mnt/mysamba
If everithing is ok I can read my file system samba under /mnt/mysamba.
1 comment 13 September 2007 at 12:10 PM
Sorry, but this post is not available in English
Add comment 14 May 2007 at 2:14 PM
This is a weeks-old note… I have preferred to give way to blog’s transfer.
To find a CSS layout with 2 columns is quite easy, but find one that fills up the page also when both columns are shorter than the browser’s height has been more hard for me. In particular to find a layout that works correctly both in new browserS (like Firefox 2 and IE7) and in IE6 is not always a walkover.
Before all, I set the height of html and body tags:
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
Now I create a box as container of all page’s contents; therefore I set its height to 100% and its width to 780 pixel (best large for a 800×600 resolution):
#container {
width: 780px;
height: 100%;
margin: 0 auto;
}
In container I can put the contents’ boxes: an header height 100 pixel, a left column (left) large 180 pixel and another one (main) that takes the space left (600 pixel). I set various background color (out of Italian Style) to easily detect their placing:
#header {
width: 100%;
height: 100px;
background-color: #000099;
/* -----
only to highlight text */
color: #FFFFFF;
font-size: 20px;
font-weight: bold;
/* ---- */
}
#left {
float: left;
width: 180px;
background-color: #FFCC33;
/* -----
only to highlight text */
color: #000066;
font-size: 20px;
font-weight: bold;
/* ---- */
}
#main {
float: right;
width: 600px;
background-color: #66CC66;
/* -----
only to highlight text */
color: #000000;
font-size: 20px;
font-weight: bold;
/* ---- */
}
Footer area must be at the bottom of the page and this can be done playing on the properties of an absolute object in a relative container. Yes indeed an absolute box coordinata are relatives to the first father box that have position relative.
So I add a relative position to container box and I create an absolute footer box, positioned at the bottom:
#container {
position: relative;
width: 780px;
height: 100%;
margin: 0 auto;
}
#footer {
position: absolute;
height: 50px;
width: 100%;
bottom: 0;
background-color: #CC0000;
/* —–
only to highlight text */
color: #000000;
font-size: 20px;
font-weight: bold;
/* —- */
}
Unfortunately, as is, IE6 does not display footer at the bottom due to float elements (left and main). To correctly work also in IE6 it needs to insert a box that does not admit float element around itself (setting value both for property clear). For this new box, that I’ll call clearCol, I set the height as the footer, in this way footer can lay perfectly over it (footer is an absolute object).
.clearCol {
clear: both;
height: 50px;
}
Page composition is above:
<div id="container"> <div id="header">Header</div> <div id="left">Left</div> <div id="main">Main</div> <div class="clearCol"></div> <div id="footer">Footer</div> </div>
Here you can see an example, in which I have deliberately left an empty column (left) and I have filled with contents the other one (main).
The left column don’t follow the height of the main column, but the matter is that new browsers (like FF2) show footer at the bottom of their height despite the scrool. This behavior is due to min-height property supported by new browsers. Luckily it’s possible to come an agreement among the old and the new browsers playing on the keyword !important, here is what I add to box container:
#container {
position: relative;
width: 780px;
height: auto !important; /* FF2 & IE7 */
height: 100%; /* IE5.x & IE6 */
min-height: 100%; /* FF2 & IE7 */
margin: 0 auto;
}
When the keyword !important is added at the end of a style declaration it is given higher precedence than an equivalent style rule that does not carry the “!important” keyword. Therefore height: 100% will be passed by modern browsers (height: auto has keyword important). Finally, when a content of a fixed height box exceeds its container, old browsers extend the container to fit the content; however the modern browsers do not have the same behavior but they support min-height property (so I set min-height: 100%).
To find a solution for background of the columns when they are shorter than the browser’s height, I can use a unique gif that includes background of left and background of main and set it as background image of container. In this case my background gif will be height 1 pixel and large 780, where the first 180 have the color of background left box and the other ones have the color of background main box, here it is (it can be also used to set background of left and main boxes).
This is the bottom line, in which I have deliberately left empty both column to see their background extends (thanks to container) untill the footer. If you use Aardvark Firefox add-on you can see the real dimension of each element.
That’s all… see you next article ![]()
Add comment 14 April 2007 at 10:02 PM
Sorry, but this post is not available in English
1 comment 23 March 2007 at 2:20 PM