APISonar


com.sun.mfwk.agent.appserv.util.Utils.log

> com > sun > mfwk > agent > appserv > util > Utils > log
com APIs sun APIs mfwk APIs agent APIs appserv APIs util APIs Utils APIs log APIs

Example 1
private String getDefaultHostName() {
	String defaultHostName = "localhost";
	try {
	    InetAddress host = InetAddress.getLocalHost();
	    defaultHostName = host.getCanonicalHostName();
	} catch(UnknownHostException uhe) {
            Utils.log(Level.INFO, "UnknownHostException: " + uhe);
        }
        return defaultHostName;
    }
Example 2
public Object handleAttribute(ObjectName peer, String attribute,
            MBeanServerConnection mbs) throws HandlerException, AttributeNotFoundException,
            MBeanException, ReflectionException, InstanceNotFoundException,
            IOException {
        Date returnValue = null;
        try {
            //FIXME -- Provide the real value later.
            returnValue = Calendar.getInstance().getTime();
        } catch (Exception exception) {
            Utils.log(Level.WARNING, "Unable to get LastOutboundActivity", exception);
            throw new HandlerException(exception);
        }

        return returnValue;
    }
Example 3
public Object handleAttribute(ObjectName peer, String attribute, 
            MBeanServerConnection mbs) throws HandlerException, AttributeNotFoundException, 
             MBeanException, ReflectionException, InstanceNotFoundException,
             IOException {
        Date returnValue = null;
        try {
            Long startTime = (Long) mbs.getAttribute(peer, attribute);
            returnValue = new Date(startTime.longValue());
            Utils.log(Level.FINE, "StartTime = " + returnValue);
        } catch (Exception ex) {
            throw new HandlerException(ex);
        }
        return returnValue;
    }
Example 4
public Object handleAttribute(ObjectName peer, String attribute, 
            MBeanServerConnection mbs) throws HandlerException, AttributeNotFoundException, 
             MBeanException, ReflectionException, InstanceNotFoundException,
             IOException {
        String configDirectory; 
        try {
            configDirectory = (String)mbs.invoke(
                new ObjectName("com.sun.appserv:type=domain,category=config"),
                    "getConfigDir", null, null);
            Utils.log(Level.FINE, "Config Directory = " + configDirectory);
        } catch (Exception ex) {
            throw new HandlerException(ex);
        }
        return configDirectory;
    }
Example 5
void unregisterListener(MBeanServerConnection connection, 
            NotificationListener client, NotificationFilter filter, Object handback)
            throws InstanceNotFoundException, ListenerNotFoundException, IOException {
        ObjectName objectName = getObjectName(connection);
        if(objectName!= null){
            assert (connection != null): "Connection not available";
            if(filter != null) {
                connection.removeNotificationListener(objectName, client, filter, handback);
            } else {
                connection.removeNotificationListener(objectName, this, filter, handback);
            }
        } else {
            Utils.log(Level.INFO, "Not a valid registered Object Name");
        }
    }
Example 6
private ObjectName getObjectName(Notification notification){
        ObjectName objectName = null;
        if(notification.getClass().getName().equals("javax.management.MBeanServerNotification")){  //NOI18N
            MBeanServerNotification msn = (MBeanServerNotification)notification;
            //printInfo(msn);
            String canonicalName = msn.getMBeanName().getCanonicalName();
            try {
                objectName = new ObjectName(canonicalName);
            } catch(javax.management.MalformedObjectNameException ex){
                Utils.log(Level.WARNING, ex.getMessage(), ex);
            }
        }
        return objectName;
    }
Example 7
public void load(ObjectName cmmObjectName) throws Exception {
        RelationMappingServiceFactory fac =
                RelationMappingServiceFactory.getInstance();
        
        RelationMappingService relationService = fac.getRelationMappingService(
                _context.getServerName(), _context.getDomainName());
        
        Utils.log(Level.FINEST, "cmmObjectName = " + cmmObjectName);
        load(cmmObjectName, relationService.getDestinationRelations(cmmObjectName.toString()), DESTINATION, relationService);
        load(cmmObjectName, relationService.getSourceRelations(cmmObjectName.toString()), SOURCE, relationService);        
    }