Home Help Center

Enhancement request: IceStorm.TopicManager.createOrRetrieve

mefostermefoster Member Mary Ellen FosterOrganization: Heriot-Watt University, EdinburghProject: ECHOES learning environment ✭✭✭
Hello all,

Every time that I need to get an IceStorm topic, I need to write the same double try-catch sequence like this:
        TopicManagerPrx tm = // ... initialisation

        TopicPrx langTopic = null;
        try {
            langTopic = tm.create(_LanguageListenerDisp.ice_staticId());
        } catch (TopicExists e) {
            try {
                langTopic = tm.retrieve(_LanguageListenerDisp.ice_staticId());
            } catch (NoSuchTopic e2) {
                logger.log(LogLevel.Warning, "Couldn't connect to language listener topic");
            }
        }

It would be really nice if TopicManagerPrx provided an atomic "createOrRetrieve" method that would encapsulate all of that boilerplate...

MEF

Comments

  • mefostermefoster Member Mary Ellen FosterOrganization: Heriot-Watt University, EdinburghProject: ECHOES learning environment ✭✭✭
    ping ... anyone else interested in this? :)

    MEF
  • denndenn Member Denn SporcicOrganization: L3 NautronixProject: Great Barrier Reef Vessel Tracking System
    Yes agreed,
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Good idea, I've added it to our TODO list for consideration in a future release.

    Mark
Sign In or Register to comment.