CON7755_Keith-CON7755-Keithx - ACTIVEevents.com

seedjaggedInternet και Εφαρμογές Web

12 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

105 εμφανίσεις

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

1

A New

Configuration Standard

for Java EE


Mike Keith

Oracle


Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

3

The following is intended to outline our general product direction.
It
is intended

for
information purposes only, and may not be incorporated into any contract.

It
is not a commitment to deliver any material, code,
or
functionality, and should
not be relied upon in making purchasing decisions. The development, release,
and timing of any features or functionality described for Oracle

s products
remains at the sole discretion of Oracle.



Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

4

Program Agenda


Defining the Problem


Consultation and Feedback


Goals and Use Cases


Sample Walkthroughs


Configuration API


Summary

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

5

What is configuration, anyway?


M
any different interested parties, many things to configure


Leads to divergent views on what configuration is


Setup for a given server environment


virtualization, installation, etc.


Define the parameters of a runtime


localization, etc.


Deployment description


Applications to deploy, etc.


Technology
-
specific components


CDI beans, wirings, etc.


Resource
-
specific settings


data sources, message queues, etc.


Scripting facility


Different granularities, varying levels of applicability

Defining the Problem

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

6

Charting a Course

After consulting with:



A number of individuals and internal groups


Individuals and companies active in enterprise Java


Active JUGs


Developers and software professionals at 3 major conferences

on 3 different continents


We have more than enough feedback and interest to chart a course!

Getting Feedback

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

7

Existing Products


VMware Spring
Config


XML and annotations to configure Spring beans and overall behavior


JBoss

Seam
Config


XML namespace strangeness to configure CDI beans


Oracle Metadata Service (MDS)


Extensive general purpose support for many different kinds of artifacts


Chef and Puppet


Server
-
based Ruby scripting support for network management

The Landscape

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

8

Lofty Ambitions


Functionality:


Solve and standardize the most common
DevOps
-
related and cloud
deployment problems in the field today


Design:


Create an initially modest service that can be enhanced in subsequent
releases


Usability:


A solution that offers a great CX (Configuration Experience!) for
DevOps

and developers


Goals

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

9

Most Common Requests and Use Cases


Cloud deployment


Wire a deployed application to multiple decoupled cloud services


Single application, multiple deployments


Don’t want to rip open application for each deployment to add custom
resources


File
-
based configuration deployment and overrides


Don’t require manual non
-
standard deployment tool to override


Environment properties 2.0


Available to one or to all apps, simple to define and manage


Use Cases (1)

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

10

Most Common Requests and Use Cases


Deployment profiles


Development, Testing, Production, etc


Platform
-
wide standard of existing tech solutions (e.g. JSF Stages, CDI
Alternatives)


Multiple modes of configuration access


Injection, integration with CDI


Java API for runtime access

Use Cases (2)

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

11

Most Common Requests and Use Cases


Scoped configuration


Visibility and accessibility settings on configurations


e.g. global/app
resources


Java SE usage


Testability with other EE technologies that run outside the container


Standalone applications with standard configuration needs


Dynamic
SaaS

tenant configuration


Admin wants to be able to add tenants (w/o restart)


SaaS

application uses an API to look up a given tenant configuration



Use Cases (3)

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

12

Other Requests


Versioned configuration


Dependency on a specific configuration version


Dynamic configuration change notification


Some apps want to be notified when a configuration change occurs


Existing Java EE
config

file integration


Single file merge of existing
configs

or
config

fragments


Clustering support


Node and cluster
-
based domain configurations



Deferred Until Later

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

13

Starting Point


Configuration archives (
e.g

.jar or .car)


Created and deployed separately from application archives


Contain resource and property configuration definitions


Container integrates deployed configurations with existing services


Applications can declare dependencies on named configurations


Injection into Java EE managed components


Java API to access configuration variables and resources


Offer functionality applicable to Java SE

Feature List

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

14

Example


Application Perspective

Development

App Archive

(EAR, WAR, JAR)

<application …
>


<application
-
name>
MyApp


</application
-
name>


...


<
required
-
configs
>


<
config


name="
myapp.config
"/>


</
required
-
configs
>


...

</application>

class
AppBean

{


@
Inject


@
Config
("app.ds
")


DataSource

someDS
;


...

}

<persistence … >


...


<
jta
-
datasource
>


java:global
/
jdbc
/
myDS


</
jta
-
datasource
>


...

</persistence>

persistence.xml

application.xm
l

AppBean

web.xml

<web
-
app
… >


...


<
servlet
-
mapping>


...



<
url
-
pattern>


${vendor}/*


</
url
-
pattern>


</
servlet
-
mapping>


...

</web
-
app>

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

15

Example


Configuration Perspective

Development

Configuration
Archive

(CAR/JAR
)

<application …
>


<application
-
name>
MyApp


</application
-
name>


...


<
required
-
configs
>


<
config


name="
myapp.config
"/>


</
required
-
configs
>


...

</application>

@Configuration("
myapp.config
")

@
ConfigProperty
(name="app.ds",


dataSource
=


@
DataSourceDefinition
(


name="
java:global
/
jdbc
/
MyDS
",


className
="org…
DataSource
",


url
="
jdbc
:…/
myDB
",


...


))

@
ConfigProperty
(name="vendor",


value="acme")

class
ConfigClass

{ }

configuration.xm
l

ConfigClass

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

16

Example


Container Perspective

Deployment

Java EE Container

App

(
EAR, WAR, JAR)

App

(EAR, WAR, JAR)

Config

(CAR/JAR)

Config

(
CAR/JAR)

Configuration Service

CDI Container

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

17

Configuration API

App Archive

(EAR, WAR, JAR)

interface
ConfigurationService

{



Configuration
getConfiguration
(String
configName
);


Collection<Configuration>
getConfigurations
(String
nameFilter
);



Object
getProperty
(String
propertyName
);


<T> T
getProperty
(String
propertyName
, Class<T>
valueClass
)

}

interface Configuration {



String
getName
();


String
getProfile
();


boolean

isGlobal
();



Object
getProperty
(String
propertyName
);


<T> T
getProperty
(String
propertyName
, Class<T>
valueClass
)

}

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

18

Configuration API
-

Example

App Archive

(EAR, WAR, JAR)

@
ManagedBean

public class
ApplicationBean

{



@Resource
ConfigurationService

configService
;


String vendor;



@
PostConstruct


public void initialize() {


vendor =
configService.getProperty
("vendor",
String.class
);


}



// ...


}

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

19

Open Questions


Runtime support


How much runtime support do we need out of the gate?


Tooling


What is the role of tools in configuration?


Generation, delta computation, etc?


Integration


How tight should the integration be in the container?


Standalone operation


Where should the lines be drawn around the standalone service?


Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

20

Summary


Decouple the configuration from the application it is configuring


Enables more flexible deployment in cloud environments


Provides customization options for multitenant applications


Platform
-
wide deployment profile settings


Increased development, testing and production control


Benefits many areas and roles:


Operations, Developers, Application vendors, Cloud providers


Start modestly but design for the future

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

21

The preceding is intended to outline our general product direction.
It
is intended
for information purposes only, and may not be incorporated into any contract
.

It
is not a commitment to
deliver any
material, code
, or
functionality, and should
not be relied upon in making purchasing decisions. The development, release,
and timing of any features or functionality described for Oracle

s products
remains at the sole discretion of Oracle.



Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

22

Graphic
Section Divider

Copyright

©

2013, Oracle and/or its affiliates. All rights reserved.

23