Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Part 1: Gateways to Fun

Here We Are Again!

The new release of ColdFusion has some interesting new Java features that just beg for a return and so here we are again! As with the previous series, I'll take the time to cover the basics of these new features before I dig a bit deeper.

Event Gateways
Undoubtedly one of the coolest new Java features in ColdFusion MX 7 is event gateways - opening up a whole new set of possibilities that were, at best, difficult, and at worst, impossible, with previous versions of ColdFusion. Providing a ColdFusion-friendlier means for working with new network protocols to more mundane things like interacting with operating system services, gateways will allow you to expand your Web applications in directions that were previously inaccessible.

The product team did an amazing job of providing a number of samples that really demonstrate the capabilities of this new feature. Add to that the really excellent Macromedia Developer Center article, some exciting postings in various blogs and some advanced articles waiting in the wings for CFDJ - all in all, there's definitely more than a little material available.

So what's the goal with this series? To provide easy-to-consume walkthroughs and tutorials for doing simple things like working with the gateway pages in the ColdFusion Administrator; and to provide a solid ground about the nuts and bolts of writing gateways.

The Basics
An event gateway is just a Java class that acts like a service to extend the ColdFusion Server. It differs from things like CFX tags in that they are threaded and can provide asynchronous communication with a ColdFusion application.

A template can call a CFX tag but that template will hang around until it is done processing before continuing to the next tag in the template. The expectation is that the CFX will perform some immediate task and return. It's possible to write a multithreaded CFX tag but there is no framework for having those subordinate threads report back once the main body of the CFX has returned control to the calling template. Event gateways solve this problem.

Event Gateway Administrator Pages
More than merely allowing you to configure things, the ColdFusion Administrator's Event Gateway pages can tell you a great deal about this new facility. As I cover the configuration pages I will introduce you to bits of gateway jargon that will be useful later when we start building applications that use gateways (for a complete list of the jargon check the product documentation; Developing ColdFusion MX Applications, Using Event Gateways, Event gateway terms and concepts).

Settings
The Event Gateways Settings page (see Figure 1) offers up a few minor, but important options, though in the Developer Edition of the product most of these settings are locked. The first is a check box for enabling gateways, which is checked by default. The second and third settings, processing threads and the size of the event queue respectively, will allow you to fine-tune gateway performance. The Developer Edition has these locked at 10 threads and 25000 events, which is quite generous for basic development.

[Note: Also on this page is a button to start the built-in SMS test server. You can use this sample SMS gateway and client simulator to explore more. I'm not going to cover it in this article as it is already discussed in some detail in the product documentation.

Gateway Types
The Event Gateways Gateway Types page (see Figure 2) provides a way for you to identify gateway classes to the ColdFusion Server, thus creating a type. There are four editable fields and a check box on this page for creating a gateway type and a list of the presently configured gateway types.

The first field, Type Name, is the name you will give the type (this is the gateway type in the jargon). There are no specific requirements, such as matching the name of the Java class or such, only something that is unique and at best meaningful to the purpose of the gateway.

The Description field provides an opportunity to input some textual content for providing more explanatory information about a gateway. The field has a limitation of 550 characters - so try to keep it simple.

The Java Class field is where you enter the name of the gateway's Java class, complete with package. This field is not so frugal as the Type Name or the Description, though if you've a class name in excess of 550 characters you might consider some package reordering and less verbose naming standards. The Java class must indicate a class that is already present in the ColdFusion Server's classpath or else it will fail when you try to add the new gateway type. Since adding jars to the Server's classpath requires a restart you will want to verify this prior to adding new gateway types. New jars can be added in the ColdFusion Class Path field on the Java and JVM page in the Server Settings section of the Administrator.

The Startup Timeout field indicates the number of seconds that the Server will allow during the startup of an event gateway before it kills it; by default this is 30 seconds. This seems a bit excessive since most system operations occur in milliseconds - and even long operations in the thousands of milliseconds fall well below this threshold.

Out of the box the Developer Edition has seven gateway types configured (shown in Figure 2 above). These default gateways provide a number of very useful facilities that satisfy many of the both basic and things-in-vogue services.

Gateway Instances
The Event Gateways Gateway Instances page (see Figure 3) allows you to create instances of a specific gateway type (a gateway instance in the jargon). This page provides three edit fields and two dropdown lists for configuring an instance and a list of the configured gateway instances.

The Gateway ID field allows you to specify a label name for a particular instance. This is the name (or gateway ID in the jargon) that will be used to programmatically reference the event gateway for sending messages. It does not have any specific requirements, though it should be unique and meaningful. The form field displayed in the browser has a limit of 550 characters which ought to be plenty even for host providers that might like to prefix a specific gateway instance name with a domain name or a corporate server prefixing with a department name.

More Stories By Guy Rish

Guy Rish is a ColdFusion and .NET developer at Vente as well as President at Gestaltech. He is an active developer and writer for various languages and technologies, and has contributed work in books on ColdFusion MX, Flash MX, and Dreamweaver MX. He blogs at ccoj.coldfusionjournal.com.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
"We've been engaging with a lot of customers including Panasonic, we've been involved with Cisco and now we're working with the U.S. government - the Department of Homeland Security," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"We provide IoT solutions. We provide the most compatible solutions for many applications. Our solutions are industry agnostic and also protocol agnostic," explained Richard Han, Head of Sales and Marketing and Engineering at Systena America, in this SYS-CON.tv interview at @ThingsExpo, held June 6-8, 2017, at the Javits Center in New York City, NY.
SYS-CON Events announced today that Calligo, an innovative cloud service provider offering mid-sized companies the highest levels of data privacy and security, has been named "Bronze Sponsor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Calligo offers unparalleled application performance guarantees, commercial flexibility and a personalised support service from its globally located cloud plat...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
"The Striim platform is a full end-to-end streaming integration and analytics platform that is middleware that covers a lot of different use cases," explained Steve Wilkes, Founder and CTO at Striim, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
SYS-CON Events announced today that DXWorldExpo has been named “Global Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
SYS-CON Events announced today that Datera, that offers a radically new data management architecture, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
"We are focused on SAP running in the clouds, to make this super easy because we believe in the tremendous value of those powerful worlds - SAP and the cloud," explained Frank Stienhans, CTO of Ocean9, Inc., in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
DX World EXPO, LLC., a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
"MobiDev is a Ukraine-based software development company. We do mobile development, and we're specialists in that. But we do full stack software development for entrepreneurs, for emerging companies, and for enterprise ventures," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
While the focus and objectives of IoT initiatives are many and diverse, they all share a few common attributes, and one of those is the network. Commonly, that network includes the Internet, over which there isn't any real control for performance and availability. Or is there? The current state of the art for Big Data analytics, as applied to network telemetry, offers new opportunities for improving and assuring operational integrity. In his session at @ThingsExpo, Jim Frey, Vice President of S...
SYS-CON Events announced today that DXWorldExpo has been named “Global Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
SYS-CON Events announced today that EnterpriseTech has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. EnterpriseTech is a professional resource for news and intelligence covering the migration of high-end technologies into the enterprise and business-IT industry, with a special focus on high-tech solutions in new product development, workload management, increased effic...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and ...
SYS-CON Events announced today that CHEETAH Training & Innovation will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct. 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CHEETAH Training & Innovation is a cloud consulting and IT training firm specializing in improving clients cloud strategies and infrastructures for medium to large companies.
SYS-CON Events announced today that Datanami has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datanami is a communication channel dedicated to providing insight, analysis and up-to-the-minute information about emerging trends and solutions in Big Data. The publication sheds light on all cutting-edge technologies including networking, storage and applications, and thei...
The current age of digital transformation means that IT organizations must adapt their toolset to cover all digital experiences, beyond just the end users’. Today’s businesses can no longer focus solely on the digital interactions they manage with employees or customers; they must now contend with non-traditional factors. Whether it's the power of brand to make or break a company, the need to monitor across all locations 24/7, or the ability to proactively resolve issues, companies must adapt to...