01: /* *****************************************************************************
02: * SWFDeserializerUtil.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
10: package org.openlaszlo.remote.swf.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: public static Logger mLogger = Logger
20: .getLogger(SWFDeserializerUtil.class);
21:
22: /**
23: * @return true if object reference isn't null and it's a Program.
24: */
25: public static boolean objRefExists(DeserializationContext context,
26: String href) {
27: Object 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 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: }
|