Use of Codec class genereted by Autotyype for xml-jave binding?

I have generated the java representation and codec classes using Autotype against xml schema. Just wondering can i use this codec class to do Java to xml binding like other tools (XMLBeans, JAXB and Castor) do. If answer is yes can you give me an example how can I use it.
Thanks,
Mujeeb

manoj,
Thanks for the help.
Sample 4 tells me that there is no code generated that I can use to write out
my non-built-in datatype to xml. For each of my non-built-in datatypes, I will
have to hand write such code, or use a handler.
John
"manojc" <[email protected]> wrote:
Here is an example of start form WSDL usecase:
http://www.manojc.com/?sample11
If you want to log the xml input/output to the web service
you can use a handler. You need to edit the web-services.xml
dd file to add handler.
Here is a example of using handler. But this use source2wsdd
instead of wsdl2service:
http://www.manojc.com/?sample4
Regards,
-manoj
"John Franey" <[email protected]> wrote in message
news:3ef30db2$[email protected]..
Hi,
I created a wsdl and used the autotype and wsdl2service ant tasks togenerate
java files.
As part of my service, I want to log output in xml format of the datareceived.
I can write my own serialization, or use the code that was generatedby
autotype.
I would rather not write my own. I want to use the code generated bywsdl2service.
Trouble is I can not find a javadoc nor a sample code segment thatshows
how!
Call me dense, but I've spent several hours on BEA web pages lookingfor
answers.
This is what I found, but I could not get to work for various reasons:
XML streaming: I have a codec (generated by autotype ant task), butit
requires
a SerializationContext. Where do I get a Serialization Context? I thinkserialize
is a callout from WS and not for applicaiton code to call.
javax.xml.rpc.encoding.Serializer: An object of this type is madeavailable by
AbstractCodec (base class of generated code, but how is this classused?
[Sorry if you've seen this posting a couple of days ago on interest.xml
newsgroup.>>  I didn't intend to repost but due to lack of response there, I thought>this newsgroup>> was more appropriate and read more.
Thanks,
John

Similar Messages

  • HELP!a class item in BOMs for select mat. components in a configurable GMTL

    Hello SAP colleague,
    Does anyone of you know what be used as a class item in BOMs for PM?
    1. I create a class as the components in a configurable bill of material of the category Assembly
    2. I create Configurable General Maintenance Task List and assign a material of the category Assembly to the general maintenance task list in the task list header  ?
    3. Unfortunately, I can't select the material components of a class item in BOMs and assign them to the task list (Msg. Item category K is not defined as a material component).
    4. If I create a maintenance order and assign a configurable general maintenance task list to it, the system recognize that the general maintenance task list is assigned to a configuration profile. It calls up characteristic valuation and only selects the relevant operations for the order from the super task list, based on the object dependencies that I specified. But system don't select the material components of a class item in BOMs.
    May I use a class item in BOMs for select material components in a configurable GMTL ?
    Many thanks for your answer.
    Mike
    Edited by: M.A. Bragin on Nov 8, 2010 1:18 PM

    If you have a list item where you have:
    Display A value 1
    Display B value 2
    Display C value 3
    Display D value 4
    If want to initial the value of the item to be A, you can set the initial value of the item to 1 in the property pane.
    Otherwise in an initialisation triger have
    :block.list_item := 1;
    HTH
    Tony

  • Biztalk WCF-SQL polling sample using a FOR XML Path

    I've been searching in the web for a sample that uses FOR XML "PATH" to poll the SQL database . The result returned from my query is a parent child data and FOR XML PATH is the best choice to structure it in that way . I guess I'm missing something while
    generating the schemas from this stored procedure.
    I guess Dan Rosanova has touched on this concept (http://social.technet.microsoft.com/wiki/contents/articles/3480.aspx)
    , but its using XML Auto. Again there is no sample available so makes things a bit difficult.
    Can someone point to a sample walkthrough , generating the schemas and then later using it in the application.
    Thanks
    Anthstone

    I used XMLPolling and it worked for me. you can go for XMLPolling. Steps to be followed:
    1) Create the SP which will have the SELECT query similar to below:
    ;WITH XMLNAMESPACES (default 'http://yourcustomnamespace')
     Select * from Employee FOR XML PATH('YourCustomRootNode') 
    2) Create a schema out of the table using the following query
    Select * from Employee for
    xml
    auto,
    xmlschema 
    3) Re-name the root name and namespace as per you mentioned in point#1 (YourCustomRootNode)
    4) Create an Envelope Schema and refer the schema from point#3. Also make a note of the root node name and namespace that we need to specify
    in the admin console.
    5) Assign the Body XPath to debatch. Refer
    this.  Deploy the solution.
    6) In the Admin console, add the Root Node Name and namespace mentioned in point#4 under "XmlStoredProcedureRoodNodeName" and "XmlStoredProcedureRoodNodeNamespace"
    There you go. I did this for debatching. You can do for nomarl batch message instead of Envelope create a normal document schema.
    Thanks
    SKGuru

  • FOR XML causing high cardinality in update statement.

    Wasn't really sure how to word this, but here it goes. I have a simple update statement that uses a sub-query to concatenate a column from a record set using the most recently recommended fashion of FOR XML. The row estimations through the XML reader show
    as 42 million rows, but the actual rows are 18k'ish.
    update d
    set d.DraftDocumentReadyDate = stuff(isnull((select ', ' + convert(varchar, wa.WorkAudit_Date, 110)
    from livelink.WAuditTrail wa inner join livelink.KUAF ku1
    on wa.WorkAudit_PerformerID_Name = ku1.Name
    where d.VolumeID = wa.WorkAudit_WorkID
    and wa.WorkAudit_Task_Title = 'Draft Document'
    and wa.WorkAudit_Status = 21
    for xml path (''), type).value('.','nvarchar(4000)'), ''), 1, 2, '')
    from #ltbl_DataDump d
    Adding image of cardinality:
    John M. Couch

    I would change this query a bit (since I like to simplify):
    ;with cte as (Select workAudit_workID, stuff(isnull((select ', ' + case when ku1.FirstName IS NULL and ku1.LastName IS NULL and ku1.Name IS NULL then 'None'
    when ku1.FirstName IS NULL and ku1.LastName IS NULL then ku1.Name
    else ku1.FirstName + ' ' + ku1.LastName
    end
    from livelink.WAuditTrail wa inner join livelink.KUAF ku1
    on wa.WorkAudit_PerformerID_Name = ku1.Name
    where wa.WorkAudit_WorkID = wa1.workAudit_workID
    and wa.WorkAudit_Task_Title = 'Draft Document'
    and wa.WorkAudit_Status = 24
    for xml path (''), type).value('.','nvarchar(4000)'), ''), 1, 2, '') as DocName,
    STUFF((SELECT ', ' + convert(varchar(20), wa.WorkAudit_Date, 110)
    from livelink.WAuditTrail wa
    where wa.WorkAudit_WorkID = wa1.workAudit_workID
    and wa.WorkAudit_Task_Title = 'Draft Document'
    and wa.WorkAudit_Status = 24
    for xml path ('')),1,2,'') as Dates
    FROM livelink.WAuditTrail wa1
    where wa1.WorkAudit_Task_Title = 'Draft Document'
    and wa1.WorkAudit_Status = 24
    GROUP BY wa1.workAudit_WorkId)
    MERGE #ltbl_DataDump d
    USING cte ON d.WolumeID = cte.workAudit_Workid
    WHEN MATCHED
    THEN UPDATE
    SET
    DraftDocumentStartedPerformer = cte.DocName,
    d.DraftDocumentStartedDate = cte.Dates
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to convert java class to dll file for using in Microsoft Technology(.n)

    hey hemmj !!!!!!
    nice replying , first of all i d like to say thanks for response me so frequently..... i like such type of guy... i d never forget ur online support.
    hey buddy, i ve a problem with applet application...
    i m working on java chat server build on swing applet. As it is chat server, it is divided into two parts, one is server application and other is client application. I want to run this server app on the client server and the basic thing with this site is that it is running on .net platform(Microsoft). and the other app ll running on the client machine or end user. Now the problem is that this site would run only if the server app ll be run on server. This server app ll open the socket of server, which ll listen the request of the user...... So, the requirement is to convert this java sever class file into dll file and register this dll file with the IIS server.So, It run and stop with the IIS server.
    I ve already search the way to convert the java class file into dll file. This is possible in such way........... below code is for the java class file...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class chatServer
    public static void main(String args[]) throws Exception
                        ServerSocket sersoc=new ServerSocket(1234);// Any port number above 1000 should do
    // as most ports below 1000 are used by system
    Vector socvec=new Vector();
    String data="";int i,j=0;
    BufferedReader in;
    //System.out.println("Listening of port " + sersoc.getLocalPort());
    //System.out.println("Waiting for connections...");
    while(true)
    Socket soc=sersoc.accept();
    socvec.addElement(soc);
    chatServerReadThread csrt=new chatServerReadThread(socvec, soc);
    in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
    PrintStream out=new PrintStream(soc.getOutputStream());
    out.println("Connected to chat server");
    out.flush();
    data= in.readLine();
    for(i=0;i<socvec.size();i++)
    soc=(Socket)socvec.elementAt(i);
    out=new PrintStream(soc.getOutputStream());
    out.println(data + " connected");
    out.flush();
    //System.out.println(data + " connected");
    csrt.start(); // error is comming from here..... plz help me.
    class chatServerReadThread extends Thread
    Vector socvec;
    PrintStream out;
    chatServerReadThread(Vector socvec, Socket soc)
    this.socvec=socvec;
    try
    out=new PrintStream(soc.getOutputStream());
    }catch(Exception e){}
    public void run()
    try
    String data;
    Socket soc;
    BufferedReader in;
    while(true)
    for(int i=0;i<socvec.size();i++)
    soc=(Socket)socvec.elementAt(i);
    in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
    if(in.ready())
    try
    data=in.readLine();
    if(data.charAt(0) == ']')
    data = in.readLine() + " exited";
    //System.out.println(data);
    socvec.removeElement(soc);
    for(int e=0;e<socvec.size();e++)
    soc=(Socket)socvec.elementAt(e);
    out=new PrintStream(soc.getOutputStream());
    out.println(data);
    out.flush();
    else
    for(int e=0;e<socvec.size();e++)
    soc=(Socket)socvec.elementAt(e);
    out=new PrintStream(soc.getOutputStream());
    out.println(data);
    out.flush();
    }catch(Exception e){socvec.removeElement(soc);}
    }catch(Exception e){e.printStackTrace();}
    first i ve made the jar file of this class
    jar cvf chatServer.jar chatServer.classafter getting the jar chatServer.jar. I ve opened the .net dos prompt and
    type this command which ll make dll file automatically....
    > jbimp /t:library chatServer.jar
    And you'll see the following output:
    Microsoft (R) Java-language bytecode to MSIL converter version 1.1.4322.0
    for Microsoft (R) .NET Framework version 1.1.4322
    Copyright (C) Microsoft Corp 2000-2002. All rights reserved.
    Created chatServer.dll
    I cant get the problem origin from where it is comming, when i tried to convert it into .dll file it shown an error that, it did not recongnized the method in first class
    public static void chatServerReadThread.start() method
    is not recognized by .net dos prompt commnad. But when i omit this method it gets created the .dll file. This start method is basically the default method of thread class that run the thread from the same class..
    By vewing the code u can visulize the thing,, i ve marked the code from where the error is comming.
    Plz do it as soon as possible, i ll waiting for ur reply......
    I ll be really thanking u for that....
    Thanx and regards
    Niraj Kumar Singh

    I wonder if this will work:
    jbimp /t:exe chatServer.jar
    Your chatServer is an application that can be started from the commandline.
    A dll is a library to be used in com, com+, other executables or ....

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • Why can we only use 1 release class for overall Release of Purchase Req?

    Hi,
    After realizing that it would be beneficial to use more than one release class for overall release of Purchase Requisition with classification, in use with release groups for overall release, I now ask if someone knows why SAP has chosen to only allow 1 release class for overall release of Purchase Requisition?
    In my scenario I would like Release group US, used for release strategies for US-plant to be able to use 1 release class with a specific set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_USD including a characteristic PR_TOTVAL_USD looking at CEBAN-GFWRT. The chosen currency for this characteristic would be USD.
    I would then like to allow Release group FR, used for release strategies for FRANCE-plant to use another release class with another set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_EUR including a characteristic PR_TOTVAL_EUR looking at CEBAN-GFWRT. The chosen currency for this characteristic would be EUR.
    In this way the release strategies for the respective release groups US and FR, could maintain their overall limit values in their respective release strategies in their own currencies.
    1. Observe that I do not want to use the same Release class for both release groups for overall release, even though I know that this is currently the only allowed option, as far as I've understood.
    2. Observe that I do not want to specify the two characteristics PR_TOTVAL_USD and PR_TOTVAL_EUR for overall value in the same release class, as this would lead to double maintenance for a large number of release strategies. Also consider the maintenance when new countries with new currencies want release strategies.
    3. Observe that I only want to use overall release.
    What I'm trying to avoid is having to continuously translate local business USD overall value limits to limits in the currency chosen for the overall value characteristic. If this for example is specified in DKK, this would lead to a need to adjust the overall value limits as soon as the exchange rate between USD and DKK changes in the system.
    Please consider this simple example:
    Local requirement is that USD purchase requisitions should be blocked when the USD value is above 1000 USD. However in my release strategy I would have to maintain a value of >5365 DDK, if DKK is chosen as the currency for overall characteristic.(e.g exchange rate 5,365).
    Next month the currency exchange rate in the system between USD and DKK has changed, and therefore I would have to go into CL24N and maintain the value to reflect the new exchange rate between USD and DKK. Lets say it has gone up to 5,435. I would now have to maintain a value of > 5435 DKK in my release strategy to correctly reflect the local business requirement of 1000 USD.
    So if anyone could please explain why SAP has taken the decision to make the Release class for overall release client specific that would be much appreciated and awarded accordingly. Also if you have any suggestion on how I could obtain the above scenario on maintaning overall value limits in different currencies than that would be awarded to.
    BR Jakob F. Skott

    You can give feed back to Apple from the iTunes drop-down menu in the iTunes menu bar..
    You can also contact the iTS Customer Service from the links on this page - http://www.apple.com/support/itunes/store/
    MJ

  • Report for finding wage types using a processing class.

    Hi All,
    Is there any standard report that gives a list of all wage types that use a processing class given as input?.
    Thanks,
    Krish

    You can use the wage type utilization for this.  Go to transaction PC00_M99_DLGA20.  Leave the wage type selection fields blank.  Select "Continuous list" as your output.  Click on the execute button.  You will see the meaning of processing classes and their values.  If you scroll down past this (should be page 3 if you look for the number to the right side of the screen), you will see a list of the processing classes and which wage types are assigned to the class by valuation.  I don't know of any other standard reports to get you this information.  I hope this helps.
    - April King

  • Why do we use only dynamic class loading for JDBC drivers

    Hi,
    My JDBC experience is that we always use dynamic class loader for drivers.
    If we have a well defined package from a vendor, why do we use this dynamic class loading feature for drivers??

    chandunitw wrote:
    Hi,
    My JDBC experience is that we always use dynamic class loader for drivers.
    If we have a well defined package from a vendor, why do we use this dynamic class loading feature for drivers??Oftentimes, the driver class name is set in a configuration file, not in code. So the thing which processes the configuration file has no idea ahead of time which driver or drivers it will support, so it is not coded specifically for any. So it loads the driver by reflection, since it is given the class name as a string it can use with the reflection API.

  • Excel opens and does not close when using the OI classes for some users...

    Hello Experts,
    I am using the OI classes(i_oi_container_control, i_oi_error, i_oi_document_proxy, i_oi_spreadsheet) to transfer Excel data to my itab. The problem we are encountering is that for some users the excel automatically opens and does not close. But in my case it is not opening so it is fine in my case. In my code I am already using the 'CLOSE_DOCUMENT' and 'RELEASE_DOCUMENT'.

    Viraylab,
    Check by any case you set the parameter register_on_close_event of the method init_control? Dont set the parameter as it will look for the corressponding custom code in your program. Also try with the method release_all_documents.
    Regards,
    Kiran Bobbala

  • To use a Threading Class for EJBs or not?

    I was wondering if someone can help me answer this question? I am going to have this class that will be used by the Beans to complete a transaction. Because I have several Beans that all need this one particular class to complete a transaction, I was wondering if it would be good to create this class in a cache type manner. Meaning this class will only be instantiated once when the server loads after that all the beans will only reference it through this class' getInstance() method. I know this class does not contain any data that needs to persist however I would like to avoid having mulitple instances of this one particular class. The class completes a rather long transaction process. It is not much from my side, but I have to wait a few seconds for the other application that I connect to, to complete the transaction, then finally get a return. This class does not do too much work, but it just needs to wait for a long time to get back a response. Since threads are lighter and cheaper than a complete process I was wondering if I should create this class that extends the thread. Below I have some basic code that can do this but I was wondering if this would be a good methodolgy for transaction heavy application. Sorry for making it too long. I have marked the class with X's to prevent the client who we connect to.
    public class XXXXXXX extends Thread {
    private static XXXXXXXX wconn = null;
    private XXXXXXXX xxc;
    private String response = null;
    public XXXXXXXX() {
    this.xxc = new XXXXXXXX ();
    * set properties *
    this.xxc.host = ""; //Connector ID
    this.xxc.port = 8800; //without SSL
    //this.xxc.port = 443; //SSL
    this.xxc.ssl = false; //SSL (if true, change port to 443!)
    this.xxc.compress = true; //compression
    this.xxc._native = true; // native request; MUST set to true for XML Pro
    this.xxc.keepalive = false; //indicates if the connection to the server should persist
    public void run()
    public static XXXXXXXX getInstance()
    return wconn;
    private other functions ....
    Thank You for any insight that you can provide.

    So you want to run something outside the containter. It doesn't matter whether you have a seperate app or just run inside the same JVM as the container. Once you are outside the container it doesn't matter how you implement it in terms of J2EE.
    It sounds to me like you just have a job and you are submitting that job for processing. You might want to examine what happens when more than one thread accesses that instance at the same time but other than that it works. You might also want to look at what happens if one or more of the other systems are down (where persisting the job on your side might make sense.)

  • How to use junit for a java class in netbeans

    hi friends,
    im new to java(fresher) and i need step by step creation of junit class for a java class in net beans6.5.so anybody plz explain me in detail.......

    Hi venkatakrishna.chaithanya,
    With NetBeans :
    - hit F1 to get the Help screen;
    - select the Search tab;
    - enter the word junit;
    - in the left pane, select *7 Creating a JUnit Test*;
    - read the intructions displayed in the right pane.

  • Could not generate Codec class

    I am new to webservices.
    My build file looks as follows:
    <project name="buildWebservice" default="ear" basedir="..">
    <target name="ear">
    <servicegen
    destEar="${staging.application.dir}/${project.name}.ear"
    contextURI="IEC"
    warName="${project.name}.war">
    <classpath>
    <pathelement path="${staging.application.dir}/${project.name}.jar"/>
    <fileset dir="${lib.dir}">
    <include name="**/*.jar"/>
    <include name="**/*.zip"/>
    </fileset>
    <pathelement path="${weblogic.jar}"/>
    </classpath>
    <service
    ejbJar="${staging.application.dir}/ejb_${project.name}.jar"
    targetNamespace="http://www.bridgebuild.com/webservices/basic/statelesSession"
    serviceName="Controller"
    serviceURI="/Controller"
    generateTypes="True"
    expandMethods="True"
    style="rpc" >
    </service>
    </servicegen>
    </target>
    </project>
    I could not generate the ControllerCode class. I mean Seralizer and Deserializer
    factory.
    I keep getting following error:
    WARNINIG: Unable to find a javaType for the xmlType:['http://www.bridgebuild.com/webservices/basic/statelesSession']:Controller.
    Make sure that you have registered this xml type in the type mapping
    Using SOAPElement instead
    WARNINIG: Unable to find a javaType for the xmlType:['http://www.bridgebuild.com/webservices/basic/statelesSession']:Controller.
    Make sure that you have registered this xml type in the type mapping
    Using SOAPElement instead
    javax.xml.rpc.JAXRPCException: failed to invoke operation. Error in the soap layer
    (jaxm); nested exception is: Message[ failed to serialize xml:weblogic.xml.schema.binding.SerializationException:
    mapping lookup failure. class=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://www.brdigebuild.com/webservices/basic/statelesSession']:Controller}]StackTrace[
    javax.xml.soap.SOAPException: failed to serialize xml:weblogic.xml.schema.binding.SerializationException:
    mapping lookup failure. class=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://www.bridgebuild.com/webservices/basic/statelesSession']:Controller}
    Any help will be appreciated.
    Thanks
    ---Radhe

    Hi
    Looks like you are using a Dynamic client to invike the service. You have to
    register the codecs in the TypeMappingRegistry.
    Look at the example at http://manojc.com sample25
    Ajay
    "Radhe" <[email protected]> wrote in message
    news:[email protected]...
    >
    I am new to webservices.
    My build file looks as follows:
    <project name="buildWebservice" default="ear" basedir="..">
    <target name="ear">
    <servicegen
    destEar="${staging.application.dir}/${project.name}.ear"
    contextURI="IEC"
    warName="${project.name}.war">
    <classpath>
    <pathelementpath="${staging.application.dir}/${project.name}.jar"/>
    <fileset dir="${lib.dir}">
    <include name="**/*.jar"/>
    <include name="**/*.zip"/>
    </fileset>
    <pathelement path="${weblogic.jar}"/>
    </classpath>
    <service
    ejbJar="${staging.application.dir}/ejb_${project.name}.jar"
    targetNamespace="http://www.bridgebuild.com/webservices/basic/statelesSessio
    n"
    serviceName="Controller"
    serviceURI="/Controller"
    generateTypes="True"
    expandMethods="True"
    style="rpc" >
    </service>
    </servicegen>
    </target>
    </project>
    I could not generate the ControllerCode class. I mean Seralizer andDeserializer
    factory.
    I keep getting following error:
    WARNINIG: Unable to find a javaType for thexmlType:['http://www.bridgebuild.com/webservices/basic/statelesSession']:Con
    troller.
    Make sure that you have registered this xml type in the type mapping
    Using SOAPElement instead
    WARNINIG: Unable to find a javaType for thexmlType:['http://www.bridgebuild.com/webservices/basic/statelesSession']:Con
    troller.
    Make sure that you have registered this xml type in the type mapping
    Using SOAPElement instead
    javax.xml.rpc.JAXRPCException: failed to invoke operation. Error in thesoap layer
    (jaxm); nested exception is: Message[ failed to serializexml:weblogic.xml.schema.binding.SerializationException:
    mapping lookup failure. class=interface javax.xml.soap.SOAPElement classcontext=TypedClassContext{schemaType=['http://www.brdigebuild.com/webservice
    s/basic/statelesSession']:Controller}]StackTrace[
    >
    javax.xml.soap.SOAPException: failed to serializexml:weblogic.xml.schema.binding.SerializationException:
    mapping lookup failure. class=interface javax.xml.soap.SOAPElement classcontext=TypedClassContext{schemaType=['http://www.bridgebuild.com/webservice
    s/basic/statelesSession']:Controller}
    >
    >
    Any help will be appreciated.
    Thanks
    ---Radhe

  • Tracking Memory usage on iOS using the Stats class

    I've been checking memory usage on an app I'm developing for iOS using the Stats class https://github.com/mrdoob/Hi-ReS-Stats ( http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3-315cd077124319488fd-7fff.html#WS 948100b6829bd5a61637f0a412623fd0543-8000).
    I added the Stats class to my project and redeployed and, yikes, memory usage reported in Stats creeps up (pretty slowly) even when there's nothing happening in the app (just showing a loaded bitmap).
    To try and track down the issue I created a project with a test class that extends Sprite with just this single call in the constructor :-
    addChild( new Stats() );
    I deployed it to the device to check that it didn't gobble any memory.
    But I was Suprised to watch the memory usage creep up and up (to approx 5) before some garbage collection kicked in and takes memory back down. I left it running and then it crept up again to over 7.5 this time before being kicked back down to just below 3.
    So 2 related questions that I'd appreciate any feedback/observations/thoughts on :-
    1 - Is this normal (i.e. memory creeping up when there's nothing other than Stats in the project) ?
    2 - What is the best way to monitor memory usage within an app ? Is Stats good enough - is Stats itself causing the memory usage ?
    All the best guys !

    Also see thread (http://forums.adobe.com/message/4280020#4280020)
    My conclusions are :-
    - If you run an app and leave it idle, memory usage gradually creeps up (presumably as memory is being used to perform calcs/refresh the display etc)
    - Periodically the garbage collection kicks in and memory is brought back down
    - This cycle could be in excess of 5 mins
    Run with your real app and memory will increase and be released much more rapidly/regularly.
    - It's probably worth performing initial checks by running on your desktop to iron out any initial problems

  • How to use the Rectangle class to draw an image and center it in a JPanel

    I sent an earlier post on how to center an image in a JPanel using the Rectangle class. I was asked to send an executable code which will show the malfunction. The code below is an executable code and a small part of a very big project. To simplifiy things, it is just a JFrame and a JPanel with an open dialog. Once executed the JFrame and the FileDialog will open. You can then navigate to a .gif or a .jpg picture and open it. What I want is for the picture to be centered in the middle of the JPanel and not the upper left corner. It is also important to stress that, I am usinig the Rectangle class to draw the Image. The region of interest is where the rectangle is created. In the constructor of the CenterRect class, I initialize the Rectangle class. Then I use paintComponent in the CenterRect class to draw the Image. The other classes are just support classes. The MyImage class is an extended image class which also has a draw() method. Any assistance in getting the Rectangle to show at the center of the JPanel without affecting the size and shape of the image will be greatly appreciated.
    I have divided the code into three parts. They are all supposed to be on one file in order to execute.
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class CenterRect extends JPanel {
        public static Rectangle srcRect;
        Insets insets = null;
        Image image;
        MyImage imp;
        private double magnification;
        private int dstWidth, dstHeight;
        public CenterRect(MyImage imp){
            insets = getInsets();
            this.imp = imp;
            int width = imp.getWidth();
            int height = imp.getHeight();
            ImagePanel.init();
            srcRect = new Rectangle(0,0, width, height);
            srcRect.setLocation(0,0);
            setDrawingSize(width, height);
            magnification = 1.0;
        public void setDrawingSize(int width, int height) {
            dstWidth = width;
            dstHeight = height;
            setSize(dstWidth, dstHeight);
        public void paintComponent(Graphics g) {
            Image img = imp.getImage();
         try {
                if (img!=null)
                    g.drawImage(img,0,0, (int)(srcRect.width*magnification), (int)(srcRect.height*magnification),
              srcRect.x, srcRect.y, srcRect.x+srcRect.width, srcRect.y+srcRect.height, null);
            catch(OutOfMemoryError e) {e.printStackTrace();}
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Opener().openImage();
    class Opener{
        private String dir;
        private String name;
        private static String defaultDirectory;
        JFrame parent;
        public Opener() {
            initComponents();
         public void initComponents(){
            parent = new JFrame();
            parent.setContentPane(ImagePanel.panel);
            parent.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            parent.setExtendedState(JFrame.MAXIMIZED_BOTH);
            parent.setVisible(true);
        public void openDialog(String title, String path){
            if (path==null || path.equals("")) {
                FileDialog fd = new FileDialog(parent, title);
                defaultDirectory = "dir.image";
                if (defaultDirectory!=null)
                    fd.setDirectory(defaultDirectory);
                fd.setVisible(true);
                name = fd.getFile();
                if (name!=null) {
                    dir = fd.getDirectory();
                    defaultDirectory = dir;
                fd.dispose();
                if (parent==null)
                    return;
            } else {
                int i = path.lastIndexOf('/');
                if (i==-1)
                    i = path.lastIndexOf('\\');
                if (i>0) {
                    dir = path.substring(0, i+1);
                    name = path.substring(i+1);
                } else {
                    dir = "";
                    name = path;
        public MyImage openImage(String directory, String name) {
            MyImage imp = openJpegOrGif(dir, name);
            return imp;
        public void openImage() {
            openDialog("Open...", "");
            String directory = dir;
            String name = this.name;
            if (name==null)
                return;
            MyImage imp = openImage(directory, name);
            if (imp!=null) imp.show();
        MyImage openJpegOrGif(String dir, String name) {
                MyImage imp = null;
                Image img = Toolkit.getDefaultToolkit().getImage(dir+name);
                if (img!=null) {
                    imp = new MyImage(name, img);
                    FileInfo fi = new FileInfo();
                    fi.fileFormat = fi.GIF_OR_JPG;
                    fi.fileName = name;
                    fi.directory = dir;
                    imp.setFileInfo(fi);
                return imp;
    }

    This is the second part. It is a continuation of the first part. They are all supposed to be on one file.
    class MyImage implements ImageObserver{
        private int imageUpdateY, imageUpdateW,width,height;
        private boolean imageLoaded;
        private static int currentID = -1;
        private int ID;
        private static Component comp;
        protected ImageProcessor ip;
        private String title;
        protected Image img;
        private static int xbase = -1;
        private static int ybase,xloc,yloc;
        private static int count = 0;
        private static final int XINC = 8;
        private static final int YINC = 12;
        private int originalScale = 1;
        private FileInfo fileInfo;
        ImagePanel win;
        /** Constructs an ImagePlus from an AWT Image. The first argument
         * will be used as the title of the window that displays the image. */
        public MyImage(String title, Image img) {
            this.title = title;
             ID = --currentID;
            if (img!=null)
                setImage(img);
        public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
             imageUpdateY = y;
             imageUpdateW = w;
             imageLoaded = (flags & (ALLBITS|FRAMEBITS|ABORT)) != 0;
         return !imageLoaded;
        public int getWidth() {
             return width;
        public int getHeight() {
             return height;
        /** Replaces the ImageProcessor, if any, with the one specified.
         * Set 'title' to null to leave the image title unchanged. */
        public void setProcessor(String title, ImageProcessor ip) {
            if (title!=null) this.title = title;
            this.ip = ip;
            img = ip.createImage();
            boolean newSize = width!=ip.getWidth() || height!=ip.getHeight();
         width = ip.getWidth();
         height = ip.getHeight();
         if (win!=null && newSize) {
                win = new ImagePanel(this);
        public void draw(){
            CenterRect ic = null;
            win = new ImagePanel(this);
            if (win!=null){
                win.addIC(this);
                win.getCanvas().repaint();
                ic = win .getCanvas();
                win.panel.add(ic);
                int width = win.imp.getWidth();
                int height = win.imp.getHeight();
                Point ijLoc = new Point(10,32);
                if (xbase==-1) {
                    xbase = 5;
                    ybase = ijLoc.y;
                    xloc = xbase;
                    yloc = ybase;
                if ((xloc+width)>ijLoc.x && yloc<(ybase+20))
                    yloc = ybase+20;
                    int x = xloc;
                    int y = yloc;
                    xloc += XINC;
                    yloc += YINC;
                    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                    count++;
                    if (count%6==0) {
                        xloc = xbase;
                        yloc = ybase;
                    int scale = 1;
                    while (xbase+XINC*4+width/scale>screen.width || ybase+YINC*4+height/scale>screen.height)
                        if (scale>1) {
                   originalScale = scale;
                   ic.setDrawingSize(width/scale, height/scale);
        /** Returns the current AWT image. */
        public Image getImage() {
            if (img==null && ip!=null)
                img = ip.createImage();
            return img;
        /** Replaces the AWT image, if any, with the one specified. */
        public void setImage(Image img) {
            waitForImage(img);
            this.img = img;
            JPanel panel = ImagePanel.panel;
            width = img.getWidth(panel);
            height = img.getHeight(panel);
            ip = null;
        /** Opens a window to display this image and clears the status bar. */
        public void show() {
            show("");
        /** Opens a window to display this image and displays
         * 'statusMessage' in the status bar. */
        public void show(String statusMessage) {
            if (img==null && ip!=null){
                img = ip.createImage();
            if ((img!=null) && (width>=0) && (height>=0)) {
                win = new ImagePanel(this);
                draw();
        private void waitForImage(Image img) {
        if (comp==null) {
            comp = ImagePanel.panel;
            if (comp==null)
                comp = new JPanel();
        imageLoaded = false;
        if (!comp.prepareImage(img, this)) {
            double progress;
            while (!imageLoaded) {
                if (imageUpdateW>1) {
                    progress = (double)imageUpdateY/imageUpdateW;
                    if (!(progress<1.0)) {
                        progress = 1.0 - (progress-1.0);
                        if (progress<0.0) progress = 0.9;
    public void setFileInfo(FileInfo fi) {
        fi.pixels = null;
        fileInfo = fi;
    }

Maybe you are looking for

  • No effect for registration the Partner Application SSO for OAS 10.1.2.0.2

    Dear OAS experts, could you please help me with the problem, it worried me for weeks: I have 2 OAS 10.1.2.0.2 on a different physical servers - 1) type Identity Management, host - OIDserver.mysite.ru, ORACLE_HOME = /d01/oracle/prd/imapp, 2) type J2EE

  • How to transfer data from an IFrame to another page

    Hi, I had a search page with a search selection and an interactive report region for the result. Then, via a button, I submitted the data from the search results to another page (plsql process). Now we have changed that and the interactive report wit

  • How many RFC Destinations / RFC Sender Channels

    Hello everybody! I have several RFC --> XI --> JDBC/FILE/SOAP integration scenarios. For each scenario I have one RFC Destination created (pointing to XI) in SM59 in R/3. For each RFC Destination I have created one RFC Sender Channel in XI. But this

  • Upgaded to 4.0 now cannot open mail in my universtiy website--"problem with xul"? Running Windows 7

    Upgraded to 4.0 have trouble with opening webmail account--can't turn in paper!!!!! --trouble shooting msg says something about XUL I can either open up e-mail in basic and not read some e-mails or write e-mails https://webmail.duke.edu/atmail.php?Lo

  • Lost my library

    Does anyone know why music rescue acknowlages my ipod for 5-10 seconds and then it says it has been disconnected? I can't get my songs off of the ipod and back into my library because my dumb father erased all of my files.