[JBossCache] - Re: FileCacheLoader partial preload
by emailmsgbox
I'm using POJO cache
this is a test code
| @PojoCacheable
| public class TestData implements Serializable {
| Map<Integer,TestKukuData> kukuMap = new HashMap<Integer,TestKukuData>();
| String myStr;
| int myInt;
| public TestData() { }
| public TestData(String myStr, int myInt) {
| this.myStr = myStr;
| this.myInt = myInt;
| }
| public Map<Integer, TestKukuData> getKukuMap() {
| return kukuMap;
| }
| public void setKukuMap(Map<Integer, TestKukuData> kukuMap) {
| this.kukuMap = kukuMap;
| }
|
| }
| PojoCacheable
| public class TestKukuData implements Serializable {
| String id;
| int miInt;
|
| public TestKukuData() { }
| public TestKukuData(String id, int miInt) {
| this.id = id;
| this.miInt = miInt;
| }
|
| public String getId() {
| return id;
| }
|
| public void setId(String id) {
| this.id = id;
| }
|
| }
|
| public class MYCache {
| final static Fqn TEST = Fqn.fromString("/kuku/test");
| static PojoCacheIfc myCache;
| ....
|
| public static TestData setTest(Integer id, TestData data){
|
| return (TestData)myCache.putObject(new Fqn(TEST,id),data);
| }
| public static TestData getTest(Integer id){
|
| return (TestData)myCache.getObject(new Fqn(TEST,id));
| }
|
|
|
| class MainTest{
| public void do(){
| int id = 1234
| TestData tData = MYCache.getTest(id);
| if(tData == null){
| TestData data = new TestData("TestData",1);
| data.getKukuMap().put(new Integer(11),new TestKukuData("kukuID1",1+id));
| data.getKukuMap().put(new Integer(22),new TestKukuData("kukuID2",2+id));
|
| MYCache.setTest(id,data);
|
| }
| else{
| int size = tData.getKukuMap.size();
| Collection c = tData.getKukuMap.values() ;
| TestKukuData kuku = (TestKukuData )ttData.getKukuMap.getObject(11)
| }
|
|
|
|
| }
|
I run this twice
first time I load the cache , then I restart Jboss
the second time size is 0 and the collection is empty
but kuku is with the right value
what am I missing ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994604#3994604
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994604
19 years, 4 months
[Beginners Corner] - Using handlers in JBoss
by Redhopter
Hi All!
I'm using JBoss 4.0.5. I have written Web Service and deployed it on JBoss.
Also I have written handler such as
| public class MHandler extends GenericHandler{
| public boolean handleRequest(MessageContext context) {
| SOAPMessageContext sctx = (SOAPMessageContext)context;
| SOAPMessage message = sctx.getMessage();
| try {
| SOAPHeader header = message.getSOAPHeader();
| String userName = header.getAttribute("username");
| String password = header.getAttribute("password");
| try {
| FileOutputStream file = new FileOutputStream("C:/Documents and Settings/kbolyand/Desktop/log.txt");
| file.write("Into Handler".getBytes());
| file.write((userName + "=" + password).getBytes());
| file.close();
| }
| catch (FileNotFoundException e) {
| e.printStackTrace();
| }
| catch (IOException e) {
| e.printStackTrace();
| }
|
| }
| catch (SOAPException e) {
| e.printStackTrace();
| }
|
| return true;
| }
| public QName[] getHeaders() {
| return new QName[0];
| }
| }
But I don't know how I must deploy this handler on JBoss WS.
Where I must put this compilled handler, what I must write in properties files?
And big second question: how I must put information into SOAP header of message?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994602#3994602
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994602
19 years, 4 months
[JBoss Portal] - Re: IceFaces in JBPortal 2.6DR1
by vitozabal
Java script error:
Line: 1668
Char: 1
Error: Object doesn't support this property or method
Code: 0
generated html code of this portlet:
<div id="default.default.HelloWorldIcefacesSeamPortletWindow">
| <div class="portlet-container"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="portlet-titlebar-left"></td><td class="portlet-titlebar-center handle"><div class="portlet-titlebar-decoration"><span class="portlet-titlebar-title">HelloWorldIcefacesSeamPortletWindow</span></div><div class="portlet-mode-container"><div class="portlet-mode-minimized" onClick="location.href='/dilsy/portal/default/default/HelloWorldIcefacesSeamPortletWindow?action=a&windowstate=minimized';" title="minimized"></div><div class="portlet-mode-maximized" onClick="location.href='/dilsy/portal/default/default/HelloWorldIcefacesSeamPortletWindow?action=a&windowstate=maximized';" title="maximized"></div></div></td><td class="portlet-titlebar-right"></td></tr><tr><td class="portlet-content-left"></td><td class="portlet-body"><div class="portlet-content-center"><script language='javascript' src='/helloworld-icefaces-seam-portlet/xmlhttp/icefaces-d2d.js'></script><iframe frameborder="0" id="history-frame" style="z-index: 10000; visibility: hidden; width: 0; height: 0; opacity: 0.22; filter: alpha(opacity=22);"></iframe><form action="iceSubmit('jbpc863eae7_id1');" class="iceForm" context_type="class com.icesoft.faces.context.BridgeFacesContext" enctype="application/x-www-form-urlencoded" id="jbpc863eae7_id1" method="post" onsubmit="return false;" style=""><input name="jbpc863eae7_id1" type="hidden" value="jbpc863eae7_id1"></input>
| <input name="icefacesCssUpdates" type="hidden" value=""></input>
| <input name="viewNumber" type="hidden" value="1004"></input>
| <input name="icefacesID" type="hidden" value="pcWeftIALIDmUpJwEh_eag"></input>
| <div class="iceOutConStat" id="connection-status" style=""><div class="iceOutConStatInactive" id="connection-idle">Active: Idle.</div>
| <div class="iceOutConStatActive" id="connection-working" style="visibility: hidden;">Active: Working...</div>
| <div class="iceOutConStatCaution" id="connection-trouble" style="visibility: hidden;">Caution: Connection in danger.</div>
| <div class="iceOutConStatDisconnect" id="connection-lost" style="visibility: hidden;">Disconnected.</div></div>
| <table border="0" cellpadding="0" cellspacing="0" class="iceTabSet" id="jbpc863eae7_id1:jbpc863eae7_id3"><tr><td class="icePanelTab" id="jbpc863eae7_id1:jbpc863eae7_id3ht0"><table cellpadding="0" cellspacing="0" class="iceTabSetTabOn"><tr><td class="LeftTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="RightTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr>
| <tr><td class="LeftMiddle"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleMiddle"><a href="#" id="jbpc863eae7_id1:jbpc863eae7_id3.0" name="jbpc863eae7_id1:jbpc863eae7_id3.0" onblur="setFocus('');" onclick="document.forms['jbpc863eae7_id1']['jbpc863eae7_id1:_idcl'].value='jbpc863eae7_id1:jbpc863eae7_id3';iceSubmitPartial( document.forms['jbpc863eae7_id1'], this,event); return false;" onfocus="setFocus(this.id);"><table cellpadding="0" cellspacing="0"><tr><td><img border="border" class="iceTabSetHdrIconLeft" src="/helloworld-icefaces-seam-portlet/images/hello.png"></img></td><td class="MiddleMiddle">Hello</td></tr></table></a></td><td class="RightMiddle"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr>
| <tr><td class="LeftBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="RightBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr></table></td><td class="icePanelTab" id="jbpc863eae7_id1:jbpc863eae7_id3ht1"><table cellpadding="0" cellspacing="0" class="iceTabSetTabOff" onmouseout="this.className='iceTabSetTabOff';" onmouseover="this.className='iceTabSetTabOver';"><tr><td class="LeftTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="RightTop"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr>
| <tr><td class="LeftMiddle"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleMiddle"><a href="#" id="jbpc863eae7_id1:jbpc863eae7_id3.1" name="jbpc863eae7_id1:jbpc863eae7_id3.1" onblur="setFocus('');" onclick="document.forms['jbpc863eae7_id1']['jbpc863eae7_id1:_idcl'].value='jbpc863eae7_id1:jbpc863eae7_id3';iceSubmitPartial( document.forms['jbpc863eae7_id1'], this,event); return false;" onfocus="setFocus(this.id);"><table cellpadding="0" cellspacing="0"><tr><td><img border="border" class="iceTabSetHdrIconLeft" src="/helloworld-icefaces-seam-portlet/images/goodbye.png"></img></td><td class="MiddleMiddle">Good Bye</td></tr></table></a></td><td class="RightMiddle"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr>
| <tr><td class="LeftBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="MiddleBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td><td class="RightBottom"><img alt="" height="1" src="/helloworld-icefaces-seam-portlet/xmlhttp/css/xp/css-images/spacer.gif" width="4"></img></td></tr></table></td><td class="iceTabSetTabSpacer"> </td></tr>
| <tr height="100%"><td class="iceTabSet" colspan="3" id="jbpc863eae7_id1:jbpc863eae7_id3td2"><span class="icePanelTab" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id4"><table border="0" class="icePnlGrd" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id5" style=""><tbody><tr class="icePnlGrdRow1"><td class="icePnlGrdColumn1" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id5-0-0"><span class="portlet-font" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id6" style="">Name:</span></td><td class="icePnlGrdColumn2" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id5-0-1"><input class="iceInputtext" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id7" name="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id7" onblur="setFocus('');iceSubmitPartial(form,this,event); return false;" onfocus="setFocus(this.id);" onkeypress="iceSubmit(form,this,event);" style="" type="text"></input></td></tr></tbody></table>
| <br><h3><span class="portlet-font" id="jbpc863eae7_id1:jbpc863eae7_id3:jbpc863eae7_id10" style=""></span></h3></span></td></tr></table>
| <input command_link_hidden_field="command_link_hidden_field" name="focus_hidden_field" type="hidden"></input>
| <input command_link_hidden_field="command_link_hidden_field" name="jbpc863eae7_id1:_ideventModel" type="hidden"></input>
| <input command_link_hidden_field="command_link_hidden_field" name="jbpc863eae7_id1:_idcl" type="hidden"></input></form><script id="dynamic-code" language="javascript"></script></div></td><td class="portlet-content-right"></td></tr><tr><td class="portlet-footer-left"></td><td class="portlet-footer-center"></td><td class="portlet-footer-right"></td></tr></table></div></div></div>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994600#3994600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994600
19 years, 4 months