KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > remote > soap > encoding > SWFDeserializerUtil


1 /* *****************************************************************************
2  * SWFDeserializerUtil.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.remote.soap.encoding;
11
12 import org.apache.axis.encoding.DeserializationContext;
13 import org.openlaszlo.iv.flash.api.action.Program;
14 import org.openlaszlo.iv.flash.api.action.Actions;
15 import org.openlaszlo.iv.flash.util.FlashBuffer;
16 import org.apache.log4j.Logger;
17
18 public class SWFDeserializerUtil
19 {
20     public static Logger mLogger =
21         Logger.getLogger(SWFDeserializerUtil.class);
22
23     /**
24      * @return true if object reference isn't null and it's a Program.
25      */

26     public static boolean objRefExists(DeserializationContext context, String JavaDoc href) {
27         Object JavaDoc ref = context.getObjectByRef(href);
28         return ref != null && (ref instanceof Program);
29     }
30
31     /**
32      * Get object reference.
33      */

34     public static void getObjectRef(Program program, String JavaDoc href) {
35         if (mLogger.isDebugEnabled()) {
36             mLogger.debug("getting object ref for " + href);
37         }
38         FlashBuffer fbuf = program.body();
39         program.push("_root");
40         program.getVar();
41         program.push("LzSOAPService");
42         fbuf.writeByte(Actions.GetMember);
43         program.push("_m");
44         fbuf.writeByte(Actions.GetMember);
45         program.push(href);
46         fbuf.writeByte(Actions.GetMember);
47     }
48 }
49
Popular Tags