Chapter 10. Advanced Topics

This chapter introduces more advanced notes on using Flamingo:

10.1. "RemoteObject" Destinations

Only destination and source properties set in the RemoteObject Flex component are processed on the server, and source takes precedence, if set. If source is not specified, destination is treated as a name of the Seam component. If source is specified, the Seam component is searched for by source.

10.2. "RemoteObject" and "HessianService" Methods/Properties Limitations

There are several limitations on the use of server methods with Flex components RemoteObject and HessianService: calls of methods logout(), disconnect() and other that are declared in classes RemoteObject, HessianService and their parent class AbstractService will not be invoked as remote server calls, but only local component calls. This limitation can be avoided by using the SeamCallSet component. For more information on methods and properties see Adobe livedocs: "AbstractService" and "RemoteObject".

10.3. "WebRemote" Configuration

By default, Seam Remoting only allows calling methods marked with the @WebRemote annotation. Flamingo by default is not dependent on this annotation, and can call any method of any Seam component. If necessary, you can limit calls to the @WebRemote methods. See the Note areas of subchapters Using Seam Remoting and Using Servlets in the Installation section for details. And there is another way of "WebRemote" configuration different from that: add the following string into the "seam.properties" file found in the root of the classpath:

flamingoConfig.webRemoteEnabled=true

10.4. Enumerated Types

As ActionScript3 has no linguistic support built in for enumerated types, Flamingo suggests a simple way to convert Java's enums types to AS3 String when using the AMF protocol as a transport. Thus, to map a field of enum type in Java class create a corresponding field of a String type in AS3 class.

Also, there is support of mapping for collections with enum used as a generic parameter. See examples below.

Here is an example for Java:



package com.exadel.example;

public class Card {

    public enum Suit { CLUBS, DIAMONDS, HEARTS, SPADES }

    private Suit suit;

    public Suit getSuit() { return suit; }

    public void setSuit(Suit suit) {
        this.suit = suit;
    }
 }

This is an example for ActionScript3:




package com.exadel.example
{
    [RemoteClass(alias="com.exadel.example.Card")]
    public class Card
    {
        public var suit:String;
    }
}