I have modeled an Audio class from the Image class. The Audio class extends WebComponent and implements IResourceListener. The component contains a byte[] aray containing the audio stream, and I am able to play audio from the web page.

My question is: When are these components flushed from memory? Is there something I should do to make them available for garbage collection?

Thanks,



Johan Compagner wrote:
If your Audio component implements IResourceListener and the audio component
holds the byte[]/audio from db Resource. Then just map the <embed tag on the audio
component

The audio component has the onComponentTag implemented
Where it writes out the src attribute to itself (the IResourceListener)

url = urlFor(IResourceListener.INTERFACE);

then:

public void onResourceRequested()
{
        resource.onResourceRequested ();
}


johan


On 5/24/06, *Michael Welter* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I have a requirement to provide a web site that allows the customer to
    drill down into database detail.  At the lowest level, the web page
    contains the normal text presentation along with zero to many "Play"
    buttons.  Each button plays a different audio file of previously
    recorded speech.  The user may or may not choose to listen to the audio.

    Everything is working except the "Play" buttons.  Hibernate/Postgres is
    a joy, and Wicket is great!

    I've modeled the Audio and LocalizedAudioResource classes from Image and
    LocalizedImageResource.  Audio implements IResourceListener.  I have the
    audio streams in memory as a result of the drill down, and, for now,
    I'm
    just creating ByteArrayResource objects for each stream (after I get it
    working, I'll create a Resource class that performs a database fetch).
    BTW, an audio stream is a java.sql.Blob.

    I create the Audio object using the ByteArratResource object.  The HTML
    tag is <embed src="<URL>" width=50 height=50>.  The <embed> tag causes
    the browser to play the track with MediaPlayer or QuickTime.

    In LocalizedAudioResource I create a ResourceStreamRequestTarget object
    and pass that to component.urlFor( obj ).  I'm to the point where I need
    to flesh-out the doEncode(RequestCycle,IRequestTarget) function within
    WebRequestCodingStrategy in order to create the URL.

    So here are some questions:

    Will the URL in the web page reference the ResourceStreamRequestTarget?
      What will that URL look like?

    Do I need to wrap the <embed> tag in a button or a link?

    Does anyone have any thoughts about the doEncode function?  Sample
    code?

    Am I on the right track, or there an easier way to do this?

    Thanks for your help.  Thanks to compagner and chillenious.




    --
    Michael Welter
    Introspect Telephony Corp.
    Denver, Colorado US
    +1.303.674.2575
    [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    www.introspect.com <http://www.introspect.com>


    -------------------------------------------------------
    All the advantages of Linux Managed Hosting--Without the Cost and Risk!
    Fully trained technicians. The highest number of Red Hat
    certifications in
    the hosting industry. Fanatical Support. Click to learn more
    http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
    <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642>
    _______________________________________________
    Wicket-user mailing list
    Wicket-user@lists.sourceforge.net
    <mailto:Wicket-user@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Michael Welter
Introspect Telephony Corp.
Denver, Colorado US
+1.303.674.2575
[EMAIL PROTECTED]
www.introspect.com


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to