KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > config > factories > HostNameFactory


1 /*
2  * $Id: HostNameFactory.java 3397 2006-10-02 22:21:36Z tcarlson $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.config.factories;
12
13 import java.net.InetAddress JavaDoc;
14 import java.util.Map JavaDoc;
15
16 import org.mule.config.PropertyFactory;
17
18 /**
19  * Extracts the local hostname from the local system
20  */

21 public class HostNameFactory implements PropertyFactory
22 {
23
24     public Object JavaDoc create(Map JavaDoc props) throws Exception JavaDoc
25     {
26         return InetAddress.getLocalHost().getHostName();
27     }
28
29 }
30
Popular Tags